PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Bifrost.Specs/Sagas/for_SagaNarrator/when_concluding_a_saga_that_is_continuing_when_there_are_no_exceptions_or_validation_errors.cs

#
C# | 29 lines | 25 code | 4 blank | 0 comment | 0 complexity | 0c16a247d957ba154f2be23d23711b25 MD5 | raw file
 1using Bifrost.Fakes.Sagas;
 2using Bifrost.Sagas;
 3using Machine.Specifications;
 4
 5namespace Bifrost.Specs.Sagas.for_SagaNarrator
 6{
 7    [Subject(typeof(SagaNarrator))]
 8    public class when_concluding_a_saga_that_is_continuing_when_there_are_no_exceptions_or_validation_errors : given.a_saga_narrator
 9    {
10        static SagaWithOneChapterProperty saga;
11        static IChapter chapter;
12        static SagaConclusion conclusion;
13
14        Establish context = () =>
15        {
16            chapter = new SimpleChapter();
17            saga = new SagaWithOneChapterProperty(chapter);
18            saga.Begin();
19            saga.Continue();
20        };
21
22        Because of = () => conclusion = narrator.Conclude(saga);
23
24        It should_have_a_successful_conclusion = () => conclusion.Success.ShouldBeTrue();
25        It should_be_valid = () => conclusion.Invalid.ShouldBeFalse();
26        It should_have_a_status_of_concluded = () => saga.IsConcluded.ShouldBeTrue();
27        It should_have_called_the_on_conclude_method = () => saga.OnConcludeCalled.ShouldEqual(1);
28    }
29}