PageRenderTime 31ms CodeModel.GetById 21ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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