PageRenderTime 6ms CodeModel.GetById 3ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
C# | 28 lines | 24 code | 4 blank | 0 comment | 0 complexity | e40a6dca64ce3c0c0345a7f7c5fed685 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_has_begun_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                                };
20
21        Because of = () => conclusion = narrator.Conclude(saga);
22
23        It should_have_a_successful_conclusion = () => conclusion.Success.ShouldBeTrue();
24        It should_be_valid = () => conclusion.Invalid.ShouldBeFalse();
25        It should_have_a_status_of_concluded = () => saga.IsConcluded.ShouldBeTrue();
26        It should_have_called_the_on_conclude_method = () => saga.OnConcludeCalled.ShouldEqual(1);
27    }
28}