private async Task <bool> NotExistAsync(PayLoadCreateCommand payLoadCreateCommand, CancellationToken cancellationToken) { var payload = await _payLoadRepository.GetByCorrelationIdAndSide( payLoadCreateCommand.CorrelationId, payLoadCreateCommand.Side); return(payload == null); }
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(); }