public void ConstructorShouldFailWhenDamageCodeReadRepositoryIsNull()
        {
            // Arrange
            var mapper = new Mock <IMapper>().Object;
            IDamageCodeReadRepository damageCodeReadRepository = null;
            var damageCodeOdataProvider = new Mock <IDamageCodeOdataProvider>().Object;

            // Act
            Action ctor = () =>
            {
                new ListDamageCodeQueryHandler(mapper, damageCodeReadRepository, damageCodeOdataProvider);
            };

            // Assert
            ctor.Should().Throw <ArgumentNullException>();
        }
Exemplo n.º 2
0
 public ListDamageCodeQueryHandler(IMapper mapper, IDamageCodeReadRepository damageCodeReadRepository, IDamageCodeOdataProvider damageCodeOdataProvider)
 {
     _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _damageCodeReadRepository = damageCodeReadRepository ?? throw new ArgumentNullException(nameof(damageCodeReadRepository));
     _damageCodeOdataProvider  = damageCodeOdataProvider ?? throw new ArgumentNullException(nameof(damageCodeOdataProvider));
 }