예제 #1
0
        public void ValidateVersionWithValidExpectedVersionThenExpectedVersionShouldBeEqualsToAggregateVersion()
        {
            //Arrange
            long           expectedVersion = -1;
            IEventSourcing source          = new StubEventSourcing();

            //Act
            source.ValidateVersion(expectedVersion);
            //Assert
            Assert.Equal(expectedVersion, source.Version);
        }
예제 #2
0
        public void ValidateVersionWithInvalidExpectedVersionShouldRaiseConcurrencyException()
        {
            //Arrange
            long           expectedVersion = 0;
            IEventSourcing source          = new StubEventSourcing();

            //Act
            //Assert
            Assert.Throws <ConcurrencyException>(()
                                                 => source.ValidateVersion(expectedVersion));
        }