コード例 #1
0
        public void FeatureCannotBeConstructed(Type feature, Exception exception, ITestResultMessage[] results)
        {
            "Given a feature with a non-static scenario but no default constructor".x(
                () => feature = typeof(FeatureWithANonStaticScenarioButNoDefaultConstructor));

            "When I run the scenarios".x(() => exception   = Record.Exception(
                                             () => results = this.Run <ITestResultMessage>(feature)));

            "Then no exception should be thrown".x(() => exception.AssertNull());

            "And the results should not be empty".x(() => results.AssertCollectionNotEmpty());

            "And each result should be a failure".x(() => results.All(result => result is ITestFailed).AssertTrue());
        }
コード例 #2
0
        public void ScenarioBodyThrowsAnException(Type feature, Exception exception, ITestResultMessage[] results)
        {
            "Given a feature with a scenario body which throws an exception".x(
                () => feature = typeof(FeatureWithAScenarioBodyWhichThrowsAnException));

            "When I run the scenarios".x(() => exception   = Record.Exception(
                                             () => results = this.Run <ITestResultMessage>(feature)));

            "Then no exception should be thrown".x(() => exception.AssertNull());

            "And the results should not be empty".x(() => results.AssertCollectionNotEmpty());

            "And each result should be a failure".x(() => results.All(result => result is ITestFailed).AssertTrue());
        }