public void ValidateVersionWithValidExpectedVersionThenExpectedVersionShouldBeEqualsToAggregateVersion() { //Arrange long expectedVersion = -1; IEventSourcing source = new StubEventSourcing(); //Act source.ValidateVersion(expectedVersion); //Assert Assert.Equal(expectedVersion, source.Version); }
public void ValidateVersionWithInvalidExpectedVersionShouldRaiseConcurrencyException() { //Arrange long expectedVersion = 0; IEventSourcing source = new StubEventSourcing(); //Act //Assert Assert.Throws <ConcurrencyException>(() => source.ValidateVersion(expectedVersion)); }