/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
- using Bifrost.Fakes.Sagas;
- using Bifrost.Sagas;
- using Machine.Specifications;
-
- namespace Bifrost.Specs.Sagas.for_SagaNarrator
- {
- [Subject(typeof(SagaNarrator))]
- public class when_concluding_a_saga_that_has_begun_when_there_are_no_exceptions_or_validation_errors : given.a_saga_narrator
- {
- static SagaWithOneChapterProperty saga;
- static IChapter chapter;
- static SagaConclusion conclusion;
-
- Establish context = () =>
- {
- chapter = new SimpleChapter();
- saga = new SagaWithOneChapterProperty(chapter);
- saga.Begin();
- };
-
- Because of = () => conclusion = narrator.Conclude(saga);
-
- It should_have_a_successful_conclusion = () => conclusion.Success.ShouldBeTrue();
- It should_be_valid = () => conclusion.Invalid.ShouldBeFalse();
- It should_have_a_status_of_concluded = () => saga.IsConcluded.ShouldBeTrue();
- It should_have_called_the_on_conclude_method = () => saga.OnConcludeCalled.ShouldEqual(1);
- }
- }