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

# · C# · 25 lines · 20 code · 5 blank · 0 comment · 0 complexity · da67a4962ac57b91bce4f5d7c5cbaaba MD5 · raw file

  1. using System;
  2. using Bifrost.Fakes.Sagas;
  3. using Bifrost.Sagas;
  4. using Machine.Specifications;
  5. namespace Bifrost.Specs.Sagas.for_SagaNarrator
  6. {
  7. [Subject(typeof(SagaNarrator))]
  8. public class when_transitioning_to_chapter_that_is_not_supported : given.a_saga_narrator
  9. {
  10. static Saga saga;
  11. static Exception exception;
  12. Establish context = () =>
  13. {
  14. saga = new Saga();
  15. saga.SetCurrentChapter(new NonTransitionalChapter());
  16. };
  17. Because of = () => exception = Catch.Exception(() => narrator.TransitionTo<TransitionalChapter>(saga));
  18. It should_throw_chapter_transition_not_allowed_exception = () => exception.ShouldBeOfType<ChapterTransitionNotAllowedException>();
  19. }
  20. }