Exemplo n.º 1
0
    public void TestFailingTestsAccounting()
    {
        var dummyTestCase = new DummyTestCase("DummyFailingTest");
        var result        = dummyTestCase.Run(m_result);

        Assert(result.GetFailingTestsCount() == 1);
    }
Exemplo n.º 2
0
    //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");
    }
Exemplo n.º 3
0
    public void TestActualTestResultSummaryFormatting()
    {
        var result        = new TestResult();
        var dummyTestCase = new DummyTestCase("DummyPassingTest");

        dummyTestCase.Run(result);
        Assert(result.Summary() == "DummyPassingTest : 1 run, 0 failed");
    }
Exemplo n.º 4
0
    public void TestBrokenSetupDetection()
    {
        var dummyTestCase = new DummyTestCase("DummyPassingTest");

        dummyTestCase.SetSetupFail(true);
        var result = dummyTestCase.Run(m_result);

        Assert(!result.IsSetupSuccessful);
    }
Exemplo n.º 5
0
    public void TestTestingPhasesWhenSetupFails()
    {
        var dummyTestCase = new DummyTestCase("DummyPassingTest");

        dummyTestCase.SetSetupFail(true);
        var result = dummyTestCase.Run(m_result);

        Assert(result.IsTeardownSuccessful);
        Assert(dummyTestCase.StateLog == "Teardown");
    }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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;
 }