Example #1
0
        public void ConstructingPersonsController_WithNullpersonsRepository_HasCorrectParameterNameForArgumentException()
        {
            // Arrange
            const string expectedParameterName = "personsRepository";

            IInsolvencyOrderPersonsRepository <InsolvencyOrderPersonModel, InsolvencyOrderPersonEntity> personsRepository = null;

            // Act
            void Constructing() => new InsolvencyOrderPersonsController(
                mockDataAccessCradle.Object,
                personsRepository,
                mockIncludeReader.Object,
                mockPageInformationProvider.Object,
                mockHalFormatter.Object,
                mockHalCollectionFormatter.Object,
                mockTelemetryClient.Object);

            // Assert
            ExceptionAssert.HasCorrectParameterNameForArgumentException(Constructing, expectedParameterName);
        }
Example #2
0
        public void ConstructingPersonsController_WithNullpersonsRepository_ThrowsArgumentNullException()
        {
            // Arrange
            IInsolvencyOrderPersonsRepository <InsolvencyOrderPersonModel, InsolvencyOrderPersonEntity> personsRepository = null;

            // Act
            void Constructing() => new InsolvencyOrderPersonsController(
                mockDataAccessCradle.Object,
                personsRepository,
                mockIncludeReader.Object,
                mockPageInformationProvider.Object,
                mockHalFormatter.Object,
                mockHalCollectionFormatter.Object,
                mockTelemetryClient.Object);

            // Assert
            Assert.ThrowsException <ArgumentNullException>((Action)Constructing);
        }