public void GetValidationRules_InflowModelTypeVerticalWall_ReturnsValidationRules()
        {
            // Setup
            var registry = new ClosingStructuresValidationRulesRegistry();

            // Call
            IEnumerable <ValidationRule> rules = registry.GetValidationRules(new ClosingStructuresInput
            {
                InflowModelType = ClosingStructureInflowModelType.VerticalWall
            });

            // Assert
            ValidationRule[] validationRules = rules.ToArray();

            Assert.AreEqual(11, validationRules.Length);

            Assert.IsInstanceOf <UseBreakWaterRule>(validationRules[0]);
            Assert.IsInstanceOf <VariationCoefficientLogNormalDistributionRule>(validationRules[1]);
            Assert.IsInstanceOf <NormalDistributionRule>(validationRules[2]);
            Assert.IsInstanceOf <NumericInputRule>(validationRules[3]);
            Assert.IsInstanceOf <NormalDistributionRule>(validationRules[4]);
            Assert.IsInstanceOf <NumericInputRule>(validationRules[5]);
            Assert.IsInstanceOf <LogNormalDistributionRule>(validationRules[6]);
            Assert.IsInstanceOf <VariationCoefficientLogNormalDistributionRule>(validationRules[7]);
            Assert.IsInstanceOf <LogNormalDistributionRule>(validationRules[8]);
            Assert.IsInstanceOf <NormalDistributionRule>(validationRules[9]);
            Assert.IsInstanceOf <VariationCoefficientLogNormalDistributionRule>(validationRules[10]);
        }
        public void GetValidationRules_InputNull_ThrowsArgumentNullException()
        {
            // Setup
            var registry = new ClosingStructuresValidationRulesRegistry();

            // Call
            TestDelegate test = () => registry.GetValidationRules(null);

            // Assert
            var exception = Assert.Throws <ArgumentNullException>(test);

            Assert.AreEqual("input", exception.ParamName);
        }
        public void GetValidationRules_InvalidInflowModelType_ThrowsInvalidEnumArgumentException()
        {
            // Setup
            var registry = new ClosingStructuresValidationRulesRegistry();

            // Call
            TestDelegate test = () => registry.GetValidationRules(new ClosingStructuresInput
            {
                InflowModelType = (ClosingStructureInflowModelType)99
            });

            // Assert
            const string message = "The value of argument 'input' (99) is invalid for Enum type 'ClosingStructureInflowModelType'.";

            TestHelper.AssertThrowsArgumentExceptionAndTestMessage <InvalidEnumArgumentException>(test, message);
        }