Пример #1
0
 public void RunSimpleTests(Session session)
 {
     TestRunner runner = new SimpleTestRunner();
     foreach (TestClassSession testClassSession in session.TestClassSessions) {
         Reporter.AddReport(runner.Run(testClassSession));
     }
     Reporter.PresentReports();
 }
Пример #2
0
        // Use this to set up the test suite
        public void Start()
        {
            Session = new Session();
            Session.AddAll(typeof(TestSample));

            Suite = new UnityTestSuite();
            TestsRunned = false;
        }
Пример #3
0
        public void RunTillAllTestsHaveBeenRunned()
        {
            Mock<TestReporter> reporterMock = new Mock<TestReporter>();
            TestSuite suite = new TestSuiteMock(reporterMock.Object);

            Session session = new Session();
            //TODO First test the test runner.
        }
Пример #4
0
 public static Session CreateSessionFor(Assembly assembly)
 {
     Session session = new Session();
     foreach (Type testClass in GetTestClassesIn(assembly)) {
         session.AddAll(testClass);
     }
     return session;
 }
Пример #5
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;
 }
Пример #6
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());
        }
Пример #7
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>());
 }