public void ConstructingHistoriesController_WithNullhistoriesRepository_HasCorrectParameterNameForArgumentException() { // Arrange const string expectedParameterName = "historiesRepository"; IInsolvencyOrderHistoriesRepository <InsolvencyOrderHistoryModel, InsolvencyOrderHistoryEntity> historiesRepository = null; // Act void Constructing() => new InsolvencyOrderHistoriesController( mockDataAccessCradle.Object, historiesRepository, mockIncludeReader.Object, mockPageInformationProvider.Object, mockHalFormatter.Object, mockHalCollectionFormatter.Object, mockTelemetryClient.Object); // Assert ExceptionAssert.HasCorrectParameterNameForArgumentException(Constructing, expectedParameterName); }
public void ConstructingHistoriesController_WithNullhistoriesRepository_ThrowsArgumentNullException() { // Arrange IInsolvencyOrderHistoriesRepository <InsolvencyOrderHistoryModel, InsolvencyOrderHistoryEntity> historiesRepository = null; // Act void Constructing() => new InsolvencyOrderHistoriesController( mockDataAccessCradle.Object, historiesRepository, mockIncludeReader.Object, mockPageInformationProvider.Object, mockHalFormatter.Object, mockHalCollectionFormatter.Object, mockTelemetryClient.Object); // Assert Assert.ThrowsException <ArgumentNullException>((Action)Constructing); }