예제 #1
0
        private async Task <bool> NotExistAsync(PayLoadCreateCommand payLoadCreateCommand, CancellationToken cancellationToken)
        {
            var payload = await _payLoadRepository.GetByCorrelationIdAndSide(
                payLoadCreateCommand.CorrelationId,
                payLoadCreateCommand.Side);

            return(payload == null);
        }
예제 #2
0
        public void Validate_WhenCommandIsValidAndPayLoadNotExists_IsValidShouldBeTrue(byte[] content)
        {
            var command = new PayLoadCreateCommand("123456", content, SideEnum.Left);

            _payLoadRepository.GetByCorrelationIdAndSide(Arg.Any <string>(), Arg.Any <SideEnum>()).ReturnsNull();

            var validationResult = _sut.Validate(command);

            validationResult.IsValid.Should().BeTrue();
        }