Пример #1
0
 public ListBusinessUnitQueryHandler(IMapper mapper,
                                     IBusinessUnitReadRepository businessUnitReadRepository,
                                     IBusinessUnitOdataProvider businessUnitOdataProvider)
 {
     _mapper = mapper ?? throw Error.ArgumentNull(nameof(mapper));
     _businessUnitReadRepository = businessUnitReadRepository ?? throw Error.ArgumentNull(nameof(businessUnitReadRepository));
     _businessUnitOdataProvider  = businessUnitOdataProvider ?? throw Error.ArgumentNull(nameof(businessUnitOdataProvider));
 }
Пример #2
0
        public void ConstructorShouldFailWhenBusinessUnitOdataProviderIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            var businessUnitReadRepository = new Mock <IBusinessUnitReadRepository>().Object;
            IBusinessUnitOdataProvider businessUnitOdataProvider = null;

            // Act
            Action ctor = () =>
            {
                new ListBusinessUnitQueryHandler(mapper, businessUnitReadRepository, businessUnitOdataProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }