Ejemplo n.º 1
0
 public ListSourceQueryHandler(IMapper mapper,
                               ISourceReadRepository sourceReadRepository,
                               ISourceOdataProvider sourceOdataProvider)
 {
     _mapper = mapper ?? throw Error.ArgumentNull(nameof(mapper));
     _sourceReadRepository = sourceReadRepository ?? throw Error.ArgumentNull(nameof(sourceReadRepository));
     _sourceOdataProvider  = sourceOdataProvider ?? throw Error.ArgumentNull(nameof(sourceOdataProvider));
 }
        public void ConstructorShouldFailWhenSourceOdataProviderIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            var sourceReadRepository = new Mock <ISourceReadRepository>().Object;
            ISourceOdataProvider sourceOdataProvider = null;

            // Act
            Action ctor = () =>
            {
                new ListSourceQueryHandler(mapper, sourceReadRepository, sourceOdataProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }