Ejemplo n.º 1
0
        public void AsyncStepExceedsTimeout(Type feature, ITestResultMessage[] results)
        {
            "Given a feature with a scenario with a single step which exceeds it's 1ms timeout"._(() =>
                feature = typeof(AsyncStepWhichExceedsTimeout));

            "When I run the scenarios"._(() =>
                results = this.Run<ITestResultMessage>(feature));

            "Then there should be one result"._(() =>
                results.Count().Should().Be(1));

            "And the result should be a failure"._(() =>
                results.Should().ContainItemsAssignableTo<ITestFailed>());

            "And the result message should be \"Test execution time exceeded: 1ms\""._(() =>
                results.Cast<ITestFailed>().Should().OnlyContain(result =>
                    result.Messages.Single() == "Test execution time exceeded: 1ms"));
        }
Ejemplo n.º 2
0
        public void AsyncVoidStepThrowsException(Type feature, ITestResultMessage[] results)
        {
            "Given a feature with a scenario that throws an invalid operation exception"._(() =>
                feature = typeof(AsyncVoidStepWhichThrowsException));

            "When I run the scenarios"._(() =>
                results = this.Run<ITestResultMessage>(feature));

            "Then the result should be a failure"._(() =>
                results.Should().ContainItemsAssignableTo<ITestFailed>());

            "And the exception should be an invalid operation exception".f(() =>
                results.Cast<ITestFailed>().First().ExceptionTypes.Single().Should().Be("System.InvalidOperationException"));
        }