Hello,
I'm running some tests against a database and verifying that data inserts
are getting rolled back. I'm doing this with a ProcessTestFixture that 1)
counts rows in several tables, 2) does some work that should get rolled
back, 3) count rows in the same tables. To make the test more maintainable,
I use a CombinatorialTest against a Factory that returns table names.

I get the following exception on the last test, and if I remove that test, I
get the exception on the first test. I'm wondering if the framework doesn't
allow parameters in TestSequence tests?

Message: Parameter count mismatch.

Type: System.Reflection.TargetParameterCountException
Source: mscorlib
TargetSite: System.Object Invoke(System.Object,
System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[],
System.Globalization.CultureInfo, Boolean)
HelpLink: null
Stack:   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo
culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at MbUnit.Core.TypeHelper.Invoke(MethodInfo method, Object o, IList args)
   at MbUnit.Core.Invokers.MethodRunInvoker.InvokeMethod(Object o, IList
args)
   at MbUnit.Core.Invokers.MethodRunInvoker.Execute(Object o, IList args)
   at MbUnit.Core.RunPipeStarter.Run(Object fixture)

Here is, approximately, the relevant part of my code:

    [ProcessTestFixture]
    public class TestEnvironmentRollbackTests
    {
        private Dictionary<string, int> _counts = new Dictionary<string,
int>();

        [Factory(typeof(string))]
        public IEnumerable<string> Tables()
        {
            yield return "Company";
            yield return "User";
            yield return "Product";
        }

        [CombinatorialTest]
        [TestSequence(0)]
        public void PreCount([UsingFactories("Tables")] string table)
        {
            _counts[table] = Util.CountTableRows(table);
        }

        [Test]
        [TestSequence(1)]
        public void DoStuff()
        {
            // do stuff
        }

        [CombinatorialTest]
        [TestSequence(2)]
        public void PostCount([UsingFactories("Tables")] string table)
        {
            Assert.AreEqual(_counts[table], Util.CountTableRows(table));
        }
    }

Thanks for any help,
Todd


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to