internal void Should_Validate_When_ExpectedVersion_IsAny( IStreamMetadata metadata, StreamExpectedVersionValidator sut) { metadata .State .Returns(StreamState.Active); FluentActions.Invoking( () => sut.Validate(metadata, StreamVersion.Any)) .Should() .NotThrow(); }
internal void Should_Throw_When_Stream_Exceeds_ExpectedVersion( IStreamMetadata metadata, StreamExpectedVersionValidator sut) { metadata .State .Returns(StreamState.Active); metadata .Version .Returns(StreamVersion.FromStreamVersion(3)); FluentActions.Invoking( () => sut.Validate(metadata, 1)) .Should() .Throw <StreamVersionConflictException>(); }