public void ConstructorShouldFailWhenStorageStatusReadRepositoryIsNull() { // Arrange var mapper = new Mock <IMapper>().Object; IStorageStatusReadRepository storageStatusReadRepository = null; var storageStatusOdataProvider = new Mock <IStorageStatusOdataProvider>().Object; // Act Action ctor = () => { new ListStorageStatusQueryHandler(mapper, storageStatusReadRepository, storageStatusOdataProvider); }; // Assert ctor.Should().Throw <ArgumentNullException>(); }
public ListStorageStatusQueryHandler(IMapper mapper, IStorageStatusReadRepository storageStatusReadRepository, IStorageStatusOdataProvider storageStatusOdataProvider) { _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); _storageStatusReadRepository = storageStatusReadRepository ?? throw new ArgumentNullException(nameof(storageStatusReadRepository)); _storageStatusOdataProvider = storageStatusOdataProvider ?? throw new ArgumentNullException(nameof(storageStatusOdataProvider)); }