PageRenderTime 35ms CodeModel.GetById 12ms 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
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using Bifrost.Events;
  4. using Bifrost.Fakes.Events;
  5. using Machine.Specifications;
  6. namespace Bifrost.Specs.Events.for_EventStream
  7. {
  8. 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
  9. {
  10. static Exception Exception;
  11. Because of = () =>
  12. {
  13. var unattachedEvent = new SimpleEvent(Guid.Empty) { Version = new EventSourceVersion(1, 0) }; ;
  14. Exception = Catch.Exception(() => EventStream.Append(new List<IEvent>() { unattachedEvent }));
  15. };
  16. It should_throw_an_exception = () => Exception.ShouldNotBeNull();
  17. }
  18. }