/Source/Bifrost.Specs/Sagas/for_SagaConverter/when_converting_to_saga_holder_with_one_chapter_and_it_is_current.cs
C# | 21 lines | 19 code | 2 blank | 0 comment | 0 complexity | 72db753d24d133e54267912e53735c9e MD5 | raw file
Possible License(s): CC-BY-SA-3.0
- using System.Collections.Generic;
- using Bifrost.Events;
- using Bifrost.Fakes.Sagas;
- using Bifrost.Sagas;
- using Bifrost.Serialization;
- using Machine.Specifications;
-
- namespace Bifrost.Specs.Sagas.for_SagaConverter
- {
- public class when_converting_to_saga_holder_with_one_chapter_and_it_is_current : given.a_saga_converter_and_a_saga_with_one_chapter_and_it_is_current
- {
- static SagaHolder saga_holder;
- Because of = () => saga_holder = saga_converter.ToSagaHolder(saga);
-
- It should_set_current_chapter_type = () => saga_holder.CurrentChapterType.ShouldEqual(typeof (SimpleChapter).AssemblyQualifiedName);
- It should_set_the_id = () => saga_holder.Id.ShouldEqual(saga.Id);
- It should_set_the_type = () => saga_holder.Type = typeof (SagaWithOneChapterProperty).AssemblyQualifiedName;
- It should_serialize_saga = () => serializer_mock.Verify(s=>s.ToJson(saga, Moq.It.IsAny<SerializationOptions>()));
- It should_convert_uncommitted_events = () => event_converter_mock.Setup(e => e.ToEventHolders(Moq.It.IsAny<IEnumerable<IEvent>>()));
- }
- }