What I want to do is run the test (preferably from an autoexecution
model) and have the output in html
I can not even figure out how to run them from within visual studio,
probably my lack of understanding.
Any Help will be greatly appreciated
Thanks
-SteveM

The code for the library that has the testsuite is the example in the
documentation
It is this:
using System;
using MbUnit.Framework;
namespace MyNamespace
{
    [TestFixture]
    public class MyClass
    {
        public delegate void TestDelegate(Object context);

        [TestSuite]
        public TestSuite GetSuite()
        {
            TestSuite suite = new TestSuite("Suite1");

            suite.Add("Test1", new TestDelegate(this.Test), "hello");
            suite.Add("Test2", new TestDelegate(this.AnotherTest),
"another test");

            return suite;
        }
        [Test]
        public void Test(object testContext)
        {
            Console.WriteLine("Test");
            Assert.AreEqual("hello", testContext);
        }
        [Test]
        public void AnotherTest(object testContext)
        {
            Console.WriteLine("AnotherTest");
            Assert.AreEqual("another test", testContext);
        }
    }
}

I then took the example from the code for the self executing and it
looks like this:
using System.Text;
using System.Reflection;
using MbUnit.Framework;
using MbUnit.Core;

namespace testExecution
{
    class Program
    {
        static int Main(string[] args)
        {
            Assembly testAssembly = Assembly.Load("TestSuiteDemo");
            using (AutoRunner runner = new AutoRunner(testAssembly))
            {
                runner.Load();
                runner.Run();
                runner.ReportToHtml();

                return runner.ExitCode;
            }
        }
    }
}

I tried using testDriven in Visual Studio and get this error:
Test result details
Expand AllCollapse All  TestSuiteDemo
Full Name:TestSuiteDemo, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null
Results:2 test, 0 success, 2 failures, 0 skipped, 0 ignored, 0
asserts
Duration: 0.00s
2/0/2/0/0/0
 MyNamespace.MyClass.MyClass (0.00s)
MbUnit.Cons.exe -filter-type:MyNamespace.MyClass "file:///C:/
CSharpProjects/MbUnitTest/TestSuiteDemo/TestSuiteDemo/bin/Debug/
TestSuiteDemo.DLL"


-   MyClass.FailedLoading(Parameters count are not equal Equal
assertion failed: [[0]]!=[[1]])
 0.000ms  0.82 Kb, 0
Type:MbUnit.Core.Exceptions.FixtureFailedLoadingException
Message:A parent fixture failed
Source:MbUnit.Framework
TargetSite:System.Object Execute(System.Object,
System.Collections.IList)
HelpLink:null
StackTrace:

   at MbUnit.Core.Invokers.FailedLoadingRunInvoker.Execute(Object o,
IList args)
   at MbUnit.Core.RunPipeStarter.Run(Object fixture, Boolean
IsExplicit)

Type:System.Exception
Message:Invalid method signature
Source:MbUnit.Framework
TargetSite:Void Check(System.Reflection.MethodInfo)
HelpLink:null
StackTrace:

   at MbUnit.Core.Reflection.SignatureChecker.Check(MethodInfo method)
   at MbUnit.Core.Runs.MethodRun.PopulateInvokerTree(RunInvokerTree
tree, RunInvokerVertex parent, Type t)

Type:MbUnit.Core.Exceptions.NotEqualAssertionException
Message:Parameters count are not equal Equal assertion failed: [[0]]!
=[[1]]
Source:MbUnit.Framework
TargetSite:Void FailNotEquals(System.Object, System.Object,
System.String, System.Object[])
HelpLink:null
StackTrace:

   at MbUnit.Framework.Assert.FailNotEquals(Object expected, Object
actual, String format, Object[] args)
   at MbUnit.Framework.Assert.AreEqual(Int32 expected, Int32 actual,
String message)
   at MbUnit.Core.Reflection.SignatureChecker.Check(MethodInfo method)



-   MyClass.FailedLoading(Parameters count are not equal Equal
assertion failed: [[0]]!=[[1]])
 0.000ms  0.00 Kb, 0
Type:MbUnit.Core.Exceptions.FixtureFailedLoadingException
Message:A parent fixture failed
Source:MbUnit.Framework
TargetSite:System.Object Execute(System.Object,
System.Collections.IList)
HelpLink:null
StackTrace:

   at MbUnit.Core.Invokers.FailedLoadingRunInvoker.Execute(Object o,
IList args)
   at MbUnit.Core.RunPipeStarter.Run(Object fixture, Boolean
IsExplicit)

Type:System.Exception
Message:Invalid method signature
Source:MbUnit.Framework
TargetSite:Void Check(System.Reflection.MethodInfo)
HelpLink:null
StackTrace:

   at MbUnit.Core.Reflection.SignatureChecker.Check(MethodInfo method)
   at MbUnit.Core.Runs.MethodRun.PopulateInvokerTree(RunInvokerTree
tree, RunInvokerVertex parent, Type t)

Type:MbUnit.Core.Exceptions.NotEqualAssertionException
Message:Parameters count are not equal Equal assertion failed: [[0]]!
=[[1]]
Source:MbUnit.Framework
TargetSite:Void FailNotEquals(System.Object, System.Object,
System.String, System.Object[])
HelpLink:null
StackTrace:

   at MbUnit.Framework.Assert.FailNotEquals(Object expected, Object
actual, String format, Object[] args)
   at MbUnit.Framework.Assert.AreEqual(Int32 expected, Int32 actual,
String message)
   at MbUnit.Core.Reflection.SignatureChecker.Check(MethodInfo method)




On Mar 31, 4:57 pm, "Andrew Stopford" <[EMAIL PROTECTED]> wrote:
> Hi Steve,
>
> Can you send your example on?
>
> Thanks
>
> Andy
>
> On 3/31/07, SteveM <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I read the TestSuiteFixture documentation and coded up the example,
> > but can not figure out how to execute it. So far trying to use
> > TestDriven from inside Visual Studio fails, and an attempt to crate a
> > selfexecuting test of the suite also fails. Can anyone shed some light
> > as to how this is to be used, and if possible how to run it as a self
> > executing test (after the example in the TestExecution section of the
> > documentation). Thanks for the help
> > -SteveM- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
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