PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. using System.Collections.Generic;
  2. using Bifrost.Events;
  3. using Bifrost.Fakes.Sagas;
  4. using Bifrost.Sagas;
  5. using Bifrost.Serialization;
  6. using Machine.Specifications;
  7. namespace Bifrost.Specs.Sagas.for_SagaConverter
  8. {
  9. 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
  10. {
  11. static SagaHolder saga_holder;
  12. Because of = () => saga_holder = saga_converter.ToSagaHolder(saga);
  13. It should_set_current_chapter_type = () => saga_holder.CurrentChapterType.ShouldEqual(typeof (SimpleChapter).AssemblyQualifiedName);
  14. It should_set_the_id = () => saga_holder.Id.ShouldEqual(saga.Id);
  15. It should_set_the_type = () => saga_holder.Type = typeof (SagaWithOneChapterProperty).AssemblyQualifiedName;
  16. It should_serialize_saga = () => serializer_mock.Verify(s=>s.ToJson(saga, Moq.It.IsAny<SerializationOptions>()));
  17. It should_convert_uncommitted_events = () => event_converter_mock.Setup(e => e.ToEventHolders(Moq.It.IsAny<IEnumerable<IEvent>>()));
  18. }
  19. }