예제 #1
0
 public UpdateInformationCommandHandler(IInformationWriteRepository informationWriteRepository,
                                        IInformationReadRepository informationReadRepository,
                                        IVersionProvider versionProvider)
 {
     _informationWriteRepository = informationWriteRepository ?? throw Error.ArgumentNull(nameof(informationWriteRepository));
     _informationReadRepository  = informationReadRepository ?? throw Error.ArgumentNull(nameof(informationReadRepository));
     _versionProvider            = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
예제 #2
0
        public void ConstructorShouldFailWhenInformationReadRepositoryIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            IInformationReadRepository informationReadRepository = null;

            // Act
            Action ctor = () =>
            {
                new GetInformationQueryHandler(mapper, informationReadRepository);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
        public void ConstructorShouldFailWhenInformationReadRepositoryIsNull()
        {
            // Arrange
            var informationWriteRepository = new Mock <IInformationWriteRepository>().Object;
            IInformationReadRepository informationReadRepository = null;
            var versionProvider = new Mock <IVersionProvider>().Object;

            // Act
            Action ctor = () =>
            {
                new UpdateInformationCommandHandler(informationWriteRepository,
                                                    informationReadRepository,
                                                    versionProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
 public ListInformationQueryHandler(IMapper mapper, IInformationReadRepository informationReadRepository)
 {
     _mapper = mapper ?? throw Error.ArgumentNull(nameof(mapper));
     _informationReadRepository = informationReadRepository ?? throw Error.ArgumentNull(nameof(informationReadRepository));
 }
 public void TestInitialize()
 {
     RepositoryTestsHelper.Init(Consts.Collections.InformationCollectionName);
     _repository = new InformationReadRepository(new PersistenceContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)));
 }