예제 #1
0
        public void ConstructorShouldFailWhencustomerOdataProviderIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            var customerReadRepository = new Mock <ICustomerReadRepository>().Object;
            ICustomerOdataProvider customerOdataProvider = null;

            // Act
            Action ctor = () =>
            {
                new ListCustomerQueryHandler(mapper, customerReadRepository, customerOdataProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
예제 #2
0
 public ListCustomerQueryHandler(IMapper mapper, ICustomerReadRepository customerReadRepository, ICustomerOdataProvider customerOdataProvider)
 {
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _customerReadRepository = customerReadRepository ?? throw new ArgumentNullException(nameof(customerReadRepository));
     _customerOdataProvider  = customerOdataProvider ?? throw new ArgumentNullException(nameof(customerOdataProvider));
 }