示例#1
0
        public void Returned_object_contains_information_about_passed_test_result()
        {
            //Arrange
            testCase = new Core.TestCase(() => { }, () => { });

            //Act
            testCase.Run();
            var report = testCase.GetReport();

            //Assert
            Assert.Equal(TestResult.Passed, report.Result);
        }
示例#2
0
        public void Contains_test_run_fail_as_case_if_test_run_fail()
        {
            //Arrange
            testCase = new Core.TestCase(
                () => { throw new System.Exception(); },
                () => { }
                );

            //Act
            testCase.Run();
            var report = testCase.GetReport();

            //Assert
            Assert.Equal("Test run failed", report.Case);
        }
示例#3
0
        public void Returned_object_contains_information_about_failed_test_result()
        {
            //Arrange
            testCase = new Core.TestCase(
                () => { throw new System.Exception(); },
                () => { }
                );

            //Act
            testCase.Run();
            var report = testCase.GetReport();

            //Assert
            Assert.Equal(TestResult.Failed, report.Result);
        }
示例#4
0
        public void Contains_assertion_exception_if_test_failed()
        {
            //Arrange
            testCase = new Core.TestCase(
                () => { throw new AssertException("Assertion message"); },
                () => { }
                );

            //Act
            testCase.Run();
            var report = testCase.GetReport();

            //Assert
            Assert.Equal(typeof(AssertException), report.Exception.GetType());
            Assert.Equal("Assertion message", report.Exception.Message);
        }
示例#5
0
        public void Contains_setup_exception_if_setup_fail()
        {
            //Arrange
            testCase = new Core.TestCase(
                () => { },
                () => { throw new System.Exception("Error message"); }
                );

            //Act
            testCase.Run();
            var report = testCase.GetReport();

            //Assert
            Assert.Equal(typeof(System.Exception), report.Exception.GetType());
            Assert.Equal("Error message", report.Exception.Message);
        }