PageRenderTime 18ms CodeModel.GetById 12ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Source/Bifrost.Specs/Events/for_EventStream/when_appending_an_event_to_a_committed_event_stream_which_has_not_been_attached_to_an_event_source.cs

#
C# | 22 lines | 18 code | 4 blank | 0 comment | 0 complexity | 2cdf21a4f9249e4cb49e2a01f7bedaab MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using Bifrost.Events;
 4using Bifrost.Fakes.Events;
 5using Machine.Specifications;
 6
 7namespace Bifrost.Specs.Events.for_EventStream
 8{
 9    public class when_appending_an_event_to_a_committed_event_stream_which_has_not_been_attached_to_an_event_source : given.an_empty_committed_event_stream
10    {
11        static Exception Exception;
12
13        Because of = () =>
14                         {
15                             var unattachedEvent = new SimpleEvent(Guid.Empty) { Version = new EventSourceVersion(1, 0) }; ;
16
17                             Exception = Catch.Exception(() => EventStream.Append(new List<IEvent>() { unattachedEvent }));
18                         };
19
20        It should_throw_an_exception = () => Exception.ShouldNotBeNull();
21    }
22}