Esempio n. 1
0
 public CreateRemarkCommandHandler(IRemarkWriteRepository remarkWriteRepository,
                                   IIdentifierProvider identifierProvider,
                                   IVersionProvider versionProvider)
 {
     _remarkWriteRepository = remarkWriteRepository ?? throw Error.ArgumentNull(nameof(remarkWriteRepository));
     _identifierProvider    = identifierProvider ?? throw Error.ArgumentNull(nameof(identifierProvider));
     _versionProvider       = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
Esempio n. 2
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));
 }
Esempio n. 3
0
        public void ConstructorShouldFailWhenRemarkWriteRepositoryIsNull()
        {
            // Arrange
            IRemarkWriteRepository remarkWriteRepository = null;

            // Act
            Action ctor = () => { new DeleteRemarkCommandHandler(remarkWriteRepository); };

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

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

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
Esempio n. 5
0
 public DeleteRemarkCommandHandler(IRemarkWriteRepository remarkWriteRepository)
 {
     _remarkWriteRepository = remarkWriteRepository ?? throw Error.ArgumentNull(nameof(remarkWriteRepository));
 }
 public void TestInitialize()
 {
     RepositoryTestsHelper.Init(Consts.Collections.RemarkCollectionName);
     _repository = new RemarkWriteRepository(new PersistenceContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)));
 }