/Framework/src/Ncqrs.Tests/Eventing/Storage/ConcurrencyExceptionSpecs.cs
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
- using System;
- using FluentAssertions;
- using Ncqrs.Eventing.Storage;
- using Xunit;
-
- namespace Ncqrs.Tests.Eventing.Storage
- {
- public class ConcurrencyExceptionSpecs : BaseExceptionTests<ConcurrencyException>
- {
- [Fact]
- public void Constructing_it_should_initialize_the_right_members()
- {
- Guid eventSourceId = Guid.NewGuid();
- long eventSourceVersion = 15;
-
- var ex = new ConcurrencyException(eventSourceId, eventSourceVersion);
-
- ex.EventSourceId.Should().Be(eventSourceId);
- ex.EventSourceVersion.Should().Be(eventSourceVersion);
- }
-
- protected override ConcurrencyException Create()
- {
- return new ConcurrencyException(Guid.NewGuid(), 15);
- }
-
- protected override void VerifyDeserialized(ConcurrencyException created, ConcurrencyException deserialized)
- {
- deserialized.EventSourceId.Should().Be(created.EventSourceId);
- deserialized.EventSourceVersion.Should().Be(created.EventSourceVersion);
- }
- }
- }