Beispiel #1
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());
        }
Beispiel #2
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>());
 }