void Ex03()
    {
        var thenStepCompleted = false;

        Given("async ThenStep that has an assertion with Exception that does not throw any exceptions", () =>
        {
            Step = FixtureSteps.CreateThenStep <ArgumentNullException>(async _ =>
            {
                await Task.Delay(100);
                thenStepCompleted = true;
            });
            ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
        });
        Given("async next ThenStep that asserts the Exception that is thrown at WhenStep", () =>
        {
            NextStep = FixtureSteps.CreateThenStep <ArgumentNullException>(async _ =>
            {
                await Task.Delay(100);
                thenStepCompleted = true;
            });
            ExpectedNextResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, NextStep);
        });
        When("the given ThenStep is run", () =>
        {
            Result = RunnerOf(Step).Run(StepResults).Build();
            StepResults.Add(Result);
        });
        Then("the given ThenStep should be awaited", () => thenStepCompleted);
        Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);

        thenStepCompleted = false;
        When("the given next ThenStep is run", () => Result = RunnerOf(NextStep).Run(StepResults).Build());
        Then("the given next ThenStep should be awaited", () => thenStepCompleted);
        Then($"the result should be as follows:{ExpectedNextResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedNextResult);
    }
Example #2
0
 void Ex03()
 {
     Given("ThenStep that has an assertion with Exception that does not throw any exception", () =>
     {
         Step           = FixtureSteps.CreateThenStep(exc => { });
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
     });
     When("the given ThenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
Example #3
0
 void Ex01()
 {
     Given("NoteStep", () =>
     {
         Step           = FixtureSteps.CreateNoteStep();
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.None, Step);
     });
     When("the given NoteStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
 void Ex03()
 {
     Given("GivenStep that does not have an arrangement", () =>
     {
         Step           = FixtureSteps.CreateGivenStep();
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Pending, Step);
     });
     When("the given GivenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
 void Ex01()
 {
     Given("WhenStep that has an action that is completed within a time-out", () =>
     {
         Step           = FixtureSteps.CreateWhenStep(100, () => { });
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
     });
     When("the given WhenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
 void Ex01()
 {
     Given("ExpectStep that has an assertion that returns true", () =>
     {
         Step           = FixtureSteps.CreateExpectStep(() => true);
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
     });
     When("the given ExpectStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
 void Ex01()
 {
     Given("ThenStep that has the type of an exception that is valid", () =>
     {
         Step           = FixtureSteps.CreateThenStep <ArgumentNullException>();
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
     });
     When("the given ThenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
Example #8
0
 void Ex03()
 {
     Given("GivenStep that has an arrangement that does not throw any exceptions", () =>
     {
         Step           = FixtureSteps.CreateGivenStep(() => { });
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Ready, Step);
     });
     Given("a result of GivenStep that has an exception", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateGivenStep()).Failed(new Exception()).Build()));
     When("the given GivenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
Example #9
0
 void Ex05()
 {
     Given("ExpectStep that has an assertion that returns true", () =>
     {
         Step           = FixtureSteps.CreateExpectStep(() => true);
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Ready, Step);
     });
     Given("a result of GivenStep that does not have Ready status", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateGivenStep()).Passed().Build()));
     Given("a result of WhenStep that has Ready status", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateWhenStep()).Ready().Build()));
     When("the given ExpectStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
 void Ex08()
 {
     Given("WhenStep that has an action that does not throw any exceptions", () =>
     {
         Step           = FixtureSteps.CreateWhenStep(() => { });
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Pending, Step);
     });
     Given("a result of GivenStep that has Passed status", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateGivenStep()).Passed().Build()));
     Given("a result of WhenStep that has Pending status", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateWhenStep()).Pending().Build()));
     When("the given WhenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
Example #11
0
 void Ex13()
 {
     Given("ThenStep that has an assertion without Exception that returns true", () =>
     {
         Step           = FixtureSteps.CreateThenStep(() => true);
         ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Pending, Step);
     });
     Given("a result of GivenStep that has Passed status", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateGivenStep()).Passed().Build()));
     Given("a result of WhenStep that has Pending status", () => StepResults.Add(FixtureStepResult.Of(FixtureSteps.CreateWhenStep()).Pending().Build()));
     When("the given ThenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
     Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
 }
    void Ex03()
    {
        var whenStepCompleted = false;

        Given("async WhenStep that has an action that is completed within a time-out", () =>
        {
            Step = FixtureSteps.CreateWhenStep(100, async() =>
            {
                await Task.Delay(50);
                whenStepCompleted = true;
            });
            ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
        });
        When("the given WhenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
        Then("the given WhenStep should be awaited", () => whenStepCompleted);
        Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
    }
    void Ex01()
    {
        var givenStepCompleted = false;

        Given("async GivenStep that has an arrangement that does not throw any exceptions", () =>
        {
            Step = FixtureSteps.CreateGivenStep(async() =>
            {
                await Task.Delay(100);
                givenStepCompleted = true;
            });
            ExpectedResult = FixtureStepResultAssertion.ForNullException(FixtureStepStatus.Passed, Step);
        });
        When("the given GivenStep is run", () => Result = RunnerOf(Step).Run(StepResults).Build());
        Then("the given GivenStep should be awaited", () => givenStepCompleted);
        Then($"the result should be as follows:{ExpectedResult.ToDescription()}", () => FixtureStepResultAssertion.Of(Result) == ExpectedResult);
    }