public void TestFailingTestsAccounting() { var dummyTestCase = new DummyTestCase("DummyFailingTest"); var result = dummyTestCase.Run(m_result); Assert(result.GetFailingTestsCount() == 1); }
//public override void Teardown() { // base.Teardown(); // m_result = null; //} public void TestTestingPhases() { var dummyTestCase = new DummyTestCase("DummyPassingTest"); dummyTestCase.Run(m_result); Assert(dummyTestCase.StateLog == "Setup Run Teardown"); }
public void TestActualTestResultSummaryFormatting() { var result = new TestResult(); var dummyTestCase = new DummyTestCase("DummyPassingTest"); dummyTestCase.Run(result); Assert(result.Summary() == "DummyPassingTest : 1 run, 0 failed"); }
public void TestBrokenSetupDetection() { var dummyTestCase = new DummyTestCase("DummyPassingTest"); dummyTestCase.SetSetupFail(true); var result = dummyTestCase.Run(m_result); Assert(!result.IsSetupSuccessful); }
public void TestTestingPhasesWhenSetupFails() { var dummyTestCase = new DummyTestCase("DummyPassingTest"); dummyTestCase.SetSetupFail(true); var result = dummyTestCase.Run(m_result); Assert(result.IsTeardownSuccessful); Assert(dummyTestCase.StateLog == "Teardown"); }
public void Description_returns_Description_from_TestCase() { // Arrange string expectedDescription = "some descripton"; var testCase = new DummyTestCase<ClassToTest>(expectedDescription); // Act var sut = MakeSut(testCase: testCase); // Assert Assert.Equal(expectedDescription, sut.Description); }
public void Arrange_with_ConditionToTest_calls_TestCase_Arrange() { // Arrange var toReturn = new ClassToTest(666); var testCase = new DummyTestCase<ClassToTest>("whatever"); testCase.StubbedArrange = () => toReturn; var sut = MakeSut(testCase: testCase); // Act var actual = sut.Arrange(); // Assert Assert.Same(toReturn, actual); }
private static DummyTestCase<ClassToTest> MakeTestCase(int identifier) { var testCase = new DummyTestCase<ClassToTest>(String.Format("test case {0}", identifier)); testCase.StubbedArrange = () => new ClassToTest(identifier); return testCase; }