public PayLoadCommandHandlerTests() { _bus = Substitute.For <IMediatorHandler>(); _payLoadRepository = Substitute.For <IPayLoadRepository>(); _sut = new PayLoadCommandHandler(_bus, _payLoadRepository); }
/// <summary> /// Initializes a new instance of <see cref="DiffCommandHandler"/> /// </summary> /// <param name="bus"></param> /// <param name="diffEngine"></param> /// <param name="payLoadRepository"></param> /// <param name="cache"></param> public DiffCommandHandler(IMediatorHandler bus, IDiffEngine diffEngine, IPayLoadRepository payLoadRepository, ICache cache) { _bus = bus ?? throw new ArgumentNullException(nameof(bus)); _diffEngine = diffEngine ?? throw new ArgumentNullException(nameof(diffEngine)); _payLoadRepository = payLoadRepository ?? throw new ArgumentNullException(nameof(payLoadRepository)); _cache = cache ?? throw new ArgumentNullException(nameof(cache)); }
public DiffCommandHandlerTests() { _bus = Substitute.For <IMediatorHandler>(); _payLoadRepository = Substitute.For <IPayLoadRepository>(); _diffEngine = Substitute.For <IDiffEngine>(); _cache = Substitute.For <ICache>(); _sut = new DiffCommandHandler(_bus, _diffEngine, _payLoadRepository, _cache); }
/// <summary> /// Initializes a new instance of <see cref="PayLoadCreateCommandValidation"/> /// </summary> /// <param name="payLoadRepository"></param> public PayLoadCreateCommandValidation(IPayLoadRepository payLoadRepository) { _payLoadRepository = payLoadRepository ?? throw new ArgumentNullException(nameof(payLoadRepository)); RuleFor(x => x.CorrelationId).NotEmpty(); RuleFor(x => x.Side).NotEqual(SideEnum.Undefined); RuleFor(x => x.Content).NotEmpty(); When(x => !string.IsNullOrWhiteSpace(x.CorrelationId), () => { RuleFor(x => x).MustAsync(NotExistAsync) .WithMessage(x => $"Payload of correlation id {x.CorrelationId} is already taken.") .WithErrorCode("PayloadAlreadyExists"); }); }
public PayLoadCreateCommandValidationTests() { _payLoadRepository = Substitute.For <IPayLoadRepository>(); _sut = new PayLoadCreateCommandValidation(_payLoadRepository); }
/// <summary> /// Initializes a new instance of <see cref="PayLoadCommandHandler"/> /// </summary> /// <param name="bus"></param> /// <param name="payLoadRepository"></param> public PayLoadCommandHandler(IMediatorHandler bus, IPayLoadRepository payLoadRepository) { _bus = bus ?? throw new ArgumentNullException(nameof(bus)); _payLoadRepository = payLoadRepository ?? throw new ArgumentNullException(nameof(payLoadRepository)); }