PageRenderTime 14ms CodeModel.GetById 1ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/Bifrost.Specs/Sagas/for_SagaCommandContext/when_committing_with_uncommitted_events_available_and_saga_has_a_chapter_property.cs

#
C# | 34 lines | 27 code | 7 blank | 0 comment | 0 complexity | d8e069dd94b2427ed70d84d716f3eb91 MD5 | raw file
 1using Bifrost.Fakes.Sagas;
 2using Bifrost.Sagas;
 3using Machine.Specifications;
 4
 5namespace Bifrost.Specs.Sagas.for_SagaCommandContext
 6{
 7    public class when_committing_with_uncommitted_events_available_and_saga_has_a_chapter_property : given.a_saga_command_context_with_aggregated_root_that_has_uncommitted_events
 8    {
 9        static SagaWithOneChapterProperty saga;
10        static SimpleChapter chapter;
11
12        Establish context = () =>
13                                {
14                                    saga = new SagaWithOneChapterProperty();
15                                    chapter = new SimpleChapter();
16                                    saga.AddChapter(chapter);
17
18                                    command_context = new SagaCommandContext(
19                                        saga,
20                                        command_mock.Object,
21                                        execution_context_mock.Object,
22                                        event_store_mock.Object,
23                                        process_method_invoker_mock.Object,
24                                        saga_librarian_mock.Object);
25
26                                    command_context.RegisterForTracking(aggregated_root_mock.Object);
27                                };
28
29        Because of = () => command_context.Commit();
30
31        It should_try_to_process_the_events_on_the_chapter = () => process_method_invoker_mock.Verify(p => p.TryProcess(chapter, simple_event));
32
33    }
34}