コード例 #1
0
 public CreateOperationCommandHandler(IOperationWriteRepository operationWriteRepository,
                                      IIdentifierProvider identifierProvider,
                                      IVersionProvider versionProvider)
 {
     _operationWriteRepository = operationWriteRepository ?? throw Error.ArgumentNull(nameof(operationWriteRepository));
     _identifierProvider       = identifierProvider ?? throw Error.ArgumentNull(nameof(identifierProvider));
     _versionProvider          = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
コード例 #2
0
 public UpdateOperationCommandHandler(IOperationWriteRepository operationWriteRepository,
                                      IOperationReadRepository operationReadRepository,
                                      IVersionProvider versionProvider)
 {
     _operationWriteRepository = operationWriteRepository ?? throw Error.ArgumentNull(nameof(operationWriteRepository));
     _operationReadRepository  = operationReadRepository ?? throw Error.ArgumentNull(nameof(operationReadRepository));
     _versionProvider          = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
コード例 #3
0
        public void ConstructorShouldFailWhenOperationWriteRepositoryIsNull()
        {
            // Arrange
            IOperationWriteRepository operationWriteRepository = null;

            // Act
            Action ctor = () => { new DeleteOperationCommandHandler(operationWriteRepository); };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
コード例 #4
0
        public void ConstructorShouldFailWhenOperationWriteRepositoryIsNull()
        {
            // Arrange
            IOperationWriteRepository operationWriteRepository = null;
            var identifierProvider = new Mock <IIdentifierProvider>().Object;
            var versionProvider    = new Mock <IVersionProvider>().Object;

            // Act
            Action ctor = () =>
            {
                new CreateOperationCommandHandler(operationWriteRepository,
                                                  identifierProvider,
                                                  versionProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
コード例 #5
0
 public void TestInitialize()
 {
     RepositoryTestsHelper.Init(Consts.Collections.OperationCollectionName);
     _repository = new OperationWriteRepository(new PersistenceContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)));
 }
コード例 #6
0
 public DeleteOperationCommandHandler(IOperationWriteRepository operationWriteRepository)
 {
     _operationWriteRepository = operationWriteRepository ?? throw Error.ArgumentNull(nameof(operationWriteRepository));
 }