That did the trick. I figured it had something to do with that.
Jay
Jonathan de Halleux wrote:
> That's because you are multiply the matches of 'DataFixture/annuity'
> times '//annuity': 24 x 24 = 526.
>
> use this to solve your problem:
> [ForEachTest(*"."*)]
>
>
>
> On 9/21/06, Jay <[EMAIL PROTECTED]> wrote:
> >
> >
> > I'm using MbUnit ver 2.3.72 (MbUnit.Framework.dll ver 1.0.2419.37446).
> > I have an xml document with 24 elements in it. Each element looks like
> > this:
> > <annuity distChannel="1" prodLine="20" plan="1" billingMode="60"
> > initialPrem = "10000.00" billingPrem="10000.00" />
> >
> > with varying data in the first couple of attributes. The test looks
> > something like this:
> >
> > [DataFixture()]
> > [XmlDataProvider("annuitytest.xml", "DataFixture/annuity")]
> > public class AnnuityPresentorTest
> > {
> > ....declare local var
> >
> > [ForEachTest("//annuity")]
> > public void AnnuityTest(XmlNode node)
> > {
> > //<annuity distChannel="1" prodLine="20" plan="4" billingMode="998"
> > initialPrem = "10000.00" billingPrem="10000.00" />
> >
> > _distChannel =
> > Convert.ToInt32(node.Attributes["distChannel"].Value);
> > _prodLine = Convert.ToInt32(node.Attributes["prodLine"].Value);
> > _plan = Convert.ToInt32(node.Attributes["plan"].Value);
> > _billMode = Convert.ToInt32(node.Attributes["billingMode"].Value);
> > _initPay = Convert.ToDecimal(node.Attributes["initialPrem"].Value);
> > _billPayment =
> > Convert.ToDecimal(node.Attributes["billingPrem"].Value);
> >
> > ...run through a handful of asserts
> > }
> >
> > Problem is that when I load this up in the MbUnit gui it tells me I
> > have 576 tests. I would expect to see 24 tests. I've stepped through
> > the code in the tests and it does try and execute the tests 576 times.
> > It appears to be squaring the number of elements in the XML document.
> > It also appears to be running through the document completely and then
> > starting over again, not running each element x number of times.
> >
> > Any ideas.
> >
> > Jay
> >
> >
> > >
> >
>
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> ------=_Part_3598_2067034.1158906255626
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 2712
>
> <div>That's because you are multiply the matches of 'DataFixture/annuity'
> times '//annuity': 24 x 24 = 526.</div>
> <div> </div>
> <div>use this to solve your problem:</div>
> <div>
> [ForEachTest(<strong>"."</strong>)]<br><br><br> </div>
> <div><span class="gmail_quote">On 9/21/06, <b
> class="gmail_sendername">Jay</b> <<a href="mailto:[EMAIL
> PROTECTED]">[EMAIL PROTECTED]</a>> wrote:</span>
> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px
> 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>I'm using MbUnit ver 2.3.72
> (MbUnit.Framework.dll ver 1.0.2419.37446).<br>I have an xml document with 24
> elements in it. Each element looks like
> <br>this:<br><annuity distChannel="1" prodLine="20"
> plan="1" billingMode="60"<br>initialPrem =
> "10000.00" billingPrem="10000.00" /><br><br>with
> varying data in the first couple of attributes. The test looks
> <br>something like
> this:<br><br>[DataFixture()]<br>[XmlDataProvider("annuitytest.xml",
> "DataFixture/annuity")]<br>public class
> AnnuityPresentorTest<br>{<br>....declare local
> var<br><br>[ForEachTest("//annuity")]
> <br>public void AnnuityTest(XmlNode node)<br>{<br>//<annuity
> distChannel="1" prodLine="20" plan="4"
> billingMode="998"<br>initialPrem = "10000.00"
> billingPrem="10000.00
> " /><br><br> _distChannel
> =<br>Convert.ToInt32(node.Attributes["distChannel"].Value);<br>
> _prodLine =
> Convert.ToInt32(node.Attributes["prodLine"].Value);<br>
> _plan = Convert.ToInt32(node.Attributes
> ["plan"].Value);<br> _billMode =
> Convert.ToInt32(node.Attributes["billingMode"].Value);<br>
> _initPay =
> Convert.ToDecimal(node.Attributes["initialPrem"].Value);<br>
> _billPayment =<br>Convert.ToDecimal
> (node.Attributes["billingPrem"].Value);<br><br> ...run
> through a handful of asserts<br>}<br><br>Problem is that when I load this up
> in the MbUnit gui it tells me I<br>have 576 tests. I would expect to see 24
> tests. I've stepped through
> <br>the code in the tests and it does try and execute the tests 576
> times.<br>It appears to be squaring the number of elements in the XML
> document.<br>It also appears to be running through the document completely
> and then
> <br>starting over again, not running each element x number of
> times.<br><br>Any
> ideas.<br><br>Jay<br><br><br><br><br></blockquote></div><br><br
> clear="all"><br>-- <br>This posting is provided "AS IS" with no
> warranties, and confers no rights.
>
> ------=_Part_3598_2067034.1158906255626--
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/MbUnitUser
-~----------~----~----~----~------~----~------~--~---