PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Framework/src/Ncqrs.Tests/Eventing/Storage/ConcurrencyExceptionSpecs.cs

http://github.com/ncqrs/ncqrs
C# | 33 lines | 28 code | 5 blank | 0 comment | 0 complexity | 2d01100c30d8ec963b93b400ca725bbf MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, Apache-2.0
  1. using System;
  2. using FluentAssertions;
  3. using Ncqrs.Eventing.Storage;
  4. using Xunit;
  5. namespace Ncqrs.Tests.Eventing.Storage
  6. {
  7. public class ConcurrencyExceptionSpecs : BaseExceptionTests<ConcurrencyException>
  8. {
  9. [Fact]
  10. public void Constructing_it_should_initialize_the_right_members()
  11. {
  12. Guid eventSourceId = Guid.NewGuid();
  13. long eventSourceVersion = 15;
  14. var ex = new ConcurrencyException(eventSourceId, eventSourceVersion);
  15. ex.EventSourceId.Should().Be(eventSourceId);
  16. ex.EventSourceVersion.Should().Be(eventSourceVersion);
  17. }
  18. protected override ConcurrencyException Create()
  19. {
  20. return new ConcurrencyException(Guid.NewGuid(), 15);
  21. }
  22. protected override void VerifyDeserialized(ConcurrencyException created, ConcurrencyException deserialized)
  23. {
  24. deserialized.EventSourceId.Should().Be(created.EventSourceId);
  25. deserialized.EventSourceVersion.Should().Be(created.EventSourceVersion);
  26. }
  27. }
  28. }