Exemplo n.º 1
0
 public UpdateRemarkCommandHandler(IRemarkWriteRepository remarkWriteRepository,
                                   IRemarkReadRepository remarkReadRepository,
                                   IVersionProvider versionProvider)
 {
     _remarkWriteRepository = remarkWriteRepository ?? throw Error.ArgumentNull(nameof(remarkWriteRepository));
     _remarkReadRepository  = remarkReadRepository ?? throw Error.ArgumentNull(nameof(remarkReadRepository));
     _versionProvider       = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
Exemplo n.º 2
0
        public void ConstructorShouldFailWhenRemarkReadRepositoryIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            IRemarkReadRepository remarkReadRepository = null;

            // Act
            Action ctor = () =>
            {
                new GetRemarkQueryHandler(mapper, remarkReadRepository);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
Exemplo n.º 3
0
        public void ConstructorShouldFailWhenRemarkReadRepositoryIsNull()
        {
            // Arrange
            var remarkWriteRepository = new Mock <IRemarkWriteRepository>().Object;
            IRemarkReadRepository remarkReadRepository = null;
            var versionProvider = new Mock <IVersionProvider>().Object;

            // Act
            Action ctor = () =>
            {
                new UpdateRemarkCommandHandler(remarkWriteRepository,
                                               remarkReadRepository,
                                               versionProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
 public void TestInitialize()
 {
     RepositoryTestsHelper.Init(Consts.Collections.RemarkCollectionName);
     _repository = new RemarkReadRepository(new PersistenceContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)));
 }
 public ListRemarkQueryHandler(IMapper mapper,
                               IRemarkReadRepository remarkReadRepository)
 {
     _mapper = mapper ?? throw Error.ArgumentNull(nameof(mapper));
     _remarkReadRepository = remarkReadRepository ?? throw Error.ArgumentNull(nameof(remarkReadRepository));
 }