/Source/Bifrost.Specs/Sagas/for_SagaNarrator/when_continuing_a_saga_that_has_not_begun.cs
C# | 29 lines | 24 code | 5 blank | 0 comment | 0 complexity | 37691d37b56caa99687a621b8b3e2ea7 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System;
- using Bifrost.Fakes.Sagas;
- using Bifrost.Sagas;
- using Bifrost.Sagas.Exceptions;
- using Machine.Specifications;
-
- namespace Bifrost.Specs.Sagas.for_SagaNarrator
- {
- [Subject(typeof(SagaNarrator))]
- public class when_continuing_a_saga_that_has_not_begun : given.a_saga_narrator
- {
- static Exception exception;
-
- static Guid saga_id;
- static SagaWithOneChapterProperty saga;
-
- Establish context = () =>
- {
- saga_id = Guid.NewGuid();
- saga = new SagaWithOneChapterProperty();
- librarian_mock.Setup(a => a.Get(saga_id)).Returns(saga);
- };
-
- Because of = () => exception = Catch.Exception( () => narrator.Continue(saga_id));
-
- It should_throw_an_invalid_saga_state_transition_exception = () => exception.ShouldBeOfType<InvalidSagaStateTransitionException>();
- It should_not_have_called_the_on_continue_method = () => saga.OnContinueCalled.ShouldEqual(0);
- }
- }