Пример #1
0
 public ScenarioContext(TGiven given, TWhen when, TThen then, ScenarioOutput output)
 {
     Given  = given;
     When   = when;
     Then   = then;
     Output = output;
 }
        public void StepSkipped_Logs_Into_Output()
        {
            //arrange.
            var output = new Mock <ITestOutputHelper>();

            var stepText = "Given something 123";
            var sut      = new ScenarioOutput(output.Object);

            //act.
            sut.StepSkipped(stepText);

            //assert.
            output.Verify(o => o.WriteLine($"{stepText}: SKIPPED"), Times.Once);
        }
Пример #3
0
 protected FeatureWhen(ScenarioOutput output, TGiven given) : base(output)
 {
     Given = given;
 }
Пример #4
0
 public ValuesFeatureWhen(ScenarioOutput output, ValuesFeatureGiven given, ValuesApiFixture valuesApiFixture)
     : base(output, given)
 {
     _valuesApiFixture = valuesApiFixture;
 }
Пример #5
0
 protected FeatureGiven(ScenarioOutput output) : base(output)
 {
 }
Пример #6
0
 protected FeatureGivenWhenThen(ScenarioOutput output)
 {
     Output = output;
 }
Пример #7
0
        void MatchScenario(ScenarioOutput o, IConcreteScenario svm)
        {
            var failure = o.FailureElement;

            string exceptionType = null;
            string failureMessage = null;
            var result = MapResult(o.Result);
            if (failure != null)
            {
                exceptionType = (string) failure.Attribute("exception-type");
                if (exceptionType == "TechTalk.SpecFlow.SpecFlowException")
                {
                    result = Status.Pending;
                }
                failureMessage = string.Format("{0}: {1}\n{2}", exceptionType, (string) failure.Element("message"), (string) failure.Element("stack-trace"));
            }
            svm.Status = result;
            svm.FailureMessage = failureMessage;
            var output = ParseOutput(o.Output);

            foreach (var stepOutcome in output)
            {
                var step = svm.Steps.FirstOrDefault(x => x.FormattedScenarioBlock +" "+ x.FormattedText == stepOutcome.Key);
                if (step != null)
                {
                    var so = stepOutcome.Value;
                    step.Status = so.Result;
                    step.ErrorMessage = so.ErrorMessage;
                    step.FullErrorMessage = so.FullErrorMessage;
                }
            }
        }
Пример #8
0
 public BasicExampleFeatureGiven(ScenarioOutput output) : base(output)
 {
 }
Пример #9
0
 public ValuesFeatureThen(ScenarioOutput output, ValuesFeatureGiven given, ValuesFeatureWhen when) : base(output,
                                                                                                          given, when)
 {
 }
Пример #10
0
 protected FeatureThen(ScenarioOutput output, TGiven given, TWhen when) : base(output)
 {
     Given = given;
     When  = when;
 }
Пример #11
0
 public BasicExampleFeatureThen(ScenarioOutput output, BasicExampleFeatureGiven given,
                                BasicExampleFeatureWhen when) : base(output, given, when)
 {
 }
Пример #12
0
 public ValuesFeatureGiven(ScenarioOutput output, IFixture fixture) : base(output)
 {
     _fixture = fixture;
 }