Exemple #1
0
        public void TestRun()
        {
            Assert.False(m_dummy.m_wasSetup);
            Assert.False(m_dummy.m_wasRun);
            Assert.False(m_dummy.m_wasTornDown);

            m_dummy.SetTestMethod("TestMethod");
            TestResult res = m_dummy.Run(null);

            Assert.NotNull(res);
            Assert.True(m_dummy.m_wasSetup);
            Assert.True(m_dummy.m_wasRun);
            Assert.True(m_dummy.m_wasTornDown);
        }
        public void TestLogResults_NoParam()
        {
            // No param
            Assert.Equal(0, m_reporter.NumFailures);
            m_reporter.LogResults(null);
            Assert.Equal(0, m_reporter.NumFailures);

            // w/ param, no test
            m_reporter.LogResults(new TestResult());
            Assert.Equal(0, m_reporter.NumFailures);

            // w/ param and tests
            Dummy test = new Dummy();

            test.SetTestMethod("TestFail");
            TestResult res = test.Run(null);

            m_reporter.LogResults(res);
            Assert.Equal(1, m_reporter.NumFailures);
        }