public void GIVEN_invalid_aggregate_root_version_WHEN_validating_aggregate_root_version_THEN_throws_exception(long aggregateRootVersion) { // Arrange // Act Action action = () => AggregateRootVersionValidator.Validate(aggregateRootVersion); // Assert action .Should() .NotThrow <AggregateRootVersionException>(); }
public void GIVEN_valid_aggregate_root_version_WHEN_validating_aggregate_root_version_THEN_does_not_throw_exception() { const long AGGREGATE_ROOT_VERSION = Constants.INITIAL_VERSION - 1; // Arrange // Act Action action = () => AggregateRootVersionValidator.Validate(AGGREGATE_ROOT_VERSION); // Assert action .Should() .Throw <AggregateRootVersionException>(); }
internal void IncrementVersion(ref long aggregateRootVersion) { AggregateRootVersionValidator.Validate(aggregateRootVersion); _version = ++aggregateRootVersion; }