/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

  1. using Bifrost.Fakes.Sagas;
  2. using Bifrost.Sagas;
  3. using Machine.Specifications;
  4. namespace Bifrost.Specs.Sagas.for_SagaNarrator
  5. {
  6. [Subject(typeof(SagaNarrator))]
  7. public class when_concluding_a_saga_that_has_begun_when_there_are_no_exceptions_or_validation_errors : given.a_saga_narrator
  8. {
  9. static SagaWithOneChapterProperty saga;
  10. static IChapter chapter;
  11. static SagaConclusion conclusion;
  12. Establish context = () =>
  13. {
  14. chapter = new SimpleChapter();
  15. saga = new SagaWithOneChapterProperty(chapter);
  16. saga.Begin();
  17. };
  18. Because of = () => conclusion = narrator.Conclude(saga);
  19. It should_have_a_successful_conclusion = () => conclusion.Success.ShouldBeTrue();
  20. It should_be_valid = () => conclusion.Invalid.ShouldBeFalse();
  21. It should_have_a_status_of_concluded = () => saga.IsConcluded.ShouldBeTrue();
  22. It should_have_called_the_on_conclude_method = () => saga.OnConcludeCalled.ShouldEqual(1);
  23. }
  24. }