public UpdateLayoutCommandHandler(ILayoutWriteRepository layoutWriteRepository,
                                   ILayoutReadRepository layoutReadRepository,
                                   IVersionProvider versionProvider)
 {
     _layoutWriteRepository = layoutWriteRepository ?? throw Error.ArgumentNull(nameof(layoutWriteRepository));
     _layoutReadRepository  = layoutReadRepository ?? throw Error.ArgumentNull(nameof(layoutReadRepository));
     _versionProvider       = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
 public CreateLayoutCommandHandler(ILayoutWriteRepository layoutWriteRepository,
                                   IIdentifierProvider identifierProvider,
                                   IVersionProvider versionProvider)
 {
     _layoutWriteRepository = layoutWriteRepository ?? throw Error.ArgumentNull(nameof(layoutWriteRepository));
     _identifierProvider    = identifierProvider ?? throw Error.ArgumentNull(nameof(identifierProvider));
     _versionProvider       = versionProvider ?? throw Error.ArgumentNull(nameof(versionProvider));
 }
        public void ConstructorShouldFailWhenWriteRepositoryIsNull()
        {
            // Arrange
            ILayoutWriteRepository layoutWriteRepository = null;

            // Act
            Action ctor = () => { new DeleteLayoutCommandHandler(layoutWriteRepository); };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
예제 #4
0
        public void ConstructorShouldFailWhenLayoutWriteRepositoryIsNull()
        {
            // Arrange
            ILayoutWriteRepository layoutWriteRepository = null;
            var layoutReadRepository = new Mock <ILayoutReadRepository>().Object;
            var versionProvider      = new Mock <IVersionProvider>().Object;

            // Act
            Action ctor = () => { new UpdateLayoutCommandHandler(layoutWriteRepository, layoutReadRepository, versionProvider); };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
 public void TestInitalize()
 {
     RepositoryTestsHelper.Init(Consts.Collections.LayoutCollectionName);
     _repository = new LayoutWriteRepository(new PersistenceContext(new PersistenceConfiguration(RepositoryTestsHelper.ConnectionString)));
 }
 public DeleteLayoutCommandHandler(ILayoutWriteRepository layoutWriteRepository)
 {
     _layoutWriteRepository = layoutWriteRepository ?? throw Error.ArgumentNull(nameof(layoutWriteRepository));
 }