Exemplo n.º 1
0
        internal void Should_Throw_When_StreamVersion_Is_Not_StartOfStream(
            long version,
            StreamState state,
            IStreamMetadata metadata,
            StreamNotEmptyValidator sut)
        {
            metadata
            .State
            .Returns(state);
            metadata
            .Version
            .Returns(version);

            FluentActions.Invoking(
                () => sut.Validate(metadata, StreamVersion.NotEmptyValue))
            .Should()
            .Throw <StreamVersionConflictException>();
        }
Exemplo n.º 2
0
        internal void Should_Validate(
            long version,
            StreamState state,
            IStreamMetadata metadata,
            StreamNotEmptyValidator sut)
        {
            metadata
            .State
            .Returns(state);
            metadata
            .Version
            .Returns(version);

            FluentActions.Invoking(
                () => sut.Validate(metadata, StreamVersion.NotEmptyValue))
            .Should()
            .NotThrow();
        }