예제 #1
0
        // Use this to set up the test suite
        public void Start()
        {
            Session = new Session();
            Session.AddAll(typeof(TestSample));

            Suite = new UnityTestSuite();
            TestsRunned = false;
        }
예제 #2
0
 public static Session CreateSessionFor(Assembly assembly)
 {
     Session session = new Session();
     foreach (Type testClass in GetTestClassesIn(assembly)) {
         session.AddAll(testClass);
     }
     return session;
 }
예제 #3
0
 public static Session CreateSessionFor(IEnumerable<Assembly> assemblies)
 {
     Session session = new Session();
     foreach (Assembly assembly in assemblies) {
         foreach (Type testClass in GetTestClassesIn(assembly)) {
             session.AddAll(testClass);
         }
     }
     return session;
 }
예제 #4
0
        public void RunningSimpleTests()
        {
            Mock<AbstractTestReporter> reporterMock = new Mock<AbstractTestReporter>();
            TestSuite suite = new TestSuiteMock(reporterMock.Object);

            Session session = new Session();
            session.AddAll(typeof(TestClass));
            session.Add(typeof(AnotherTestClass).GetMethod("Blub"));
            suite.RunSimpleTests(session);
            AssertThatTheMethodsAreCalledCorrectlyAfterRunningAllSimpleTests();
            reporterMock.Verify(rep => rep.PresentReports(), Times.Once());
        }
예제 #5
0
 public void AddingTests()
 {
     Session session = new Session();
     AssertEx.That(() => session.AddAll(typeof(NotAttributedMock)), Throws.An<ArgumentException>());
     AssertEx.That(() => session.Add(typeof(NotAttributedMock).GetMethod("Foo")), Throws.An<ArgumentException>());
 }