Exemple #1
0
 public ListOperationalDepartmentQueryHandler(IMapper mapper,
                                              IOperationalDepartmentReadRepository operationalDepartmentReadRepository,
                                              IOperationalDepartmentOdataProvider operationalDepartmentOdataProvider)
 {
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _operationalDepartmentReadRepository = operationalDepartmentReadRepository ?? throw new ArgumentNullException(nameof(operationalDepartmentReadRepository));
     _operationalDepartmentOdataProvider  = operationalDepartmentOdataProvider ?? throw new ArgumentNullException(nameof(operationalDepartmentOdataProvider));
 }
Exemple #2
0
        public void ConstructorShouldFailWhenOperationalDepartmentReadRepositoryIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            IOperationalDepartmentReadRepository operationalDepartmentReadRepository = null;
            var operationalDepartmentOdataProvider = new Mock <IOperationalDepartmentOdataProvider>().Object;

            // Act
            Action ctor = () =>
            {
                new ListOperationalDepartmentQueryHandler(mapper, operationalDepartmentReadRepository, operationalDepartmentOdataProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
 public void TestInitialize()
 {
     RepositoryTestsHelper.Init(Consts.Collections.OperationalDepartmentCollectionName);
     _repository = new OperationalDepartmentReadRepository(new PersistenceContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)));
 }