public void Constructor_ExpectedValues()
        {
            // Call
            var hydraRingCalculationInput = new HydraRingCalculationInputImplementation(1);

            // Assert
            Assert.AreEqual(1, hydraRingCalculationInput.HydraulicBoundaryLocationId);
            CollectionAssert.IsEmpty(hydraRingCalculationInput.Variables);
            CollectionAssert.IsEmpty(hydraRingCalculationInput.ProfilePoints);
            CollectionAssert.IsEmpty(hydraRingCalculationInput.ForelandPoints);
            Assert.IsNull(hydraRingCalculationInput.BreakWater);
            Assert.IsNaN(hydraRingCalculationInput.Beta);
            Assert.AreEqual(3, hydraRingCalculationInput.IterationMethodId);
        }
Beispiel #2
0
        public void AddHydraRingCalculationInput_DuplicateSectionId_ThrowsArgumentException()
        {
            // Setup
            var hydraRingConfigurationService = new HydraRingConfigurationService(HydraRingUncertaintiesType.Model);
            var calculationInput1             = new HydraRingCalculationInputImplementation(1, 2);
            var calculationInput2             = new HydraRingCalculationInputImplementation(1, 3);

            hydraRingConfigurationService.AddHydraRingCalculationInput(calculationInput1);

            // Call
            TestDelegate test = () => hydraRingConfigurationService.AddHydraRingCalculationInput(calculationInput2);

            // Assert
            const string expectedMessage = "Section id is not unique";

            TestHelper.AssertThrowsArgumentExceptionAndTestMessage <ArgumentException>(test, expectedMessage);
        }
Beispiel #3
0
        public void AddHydraRingCalculationInput_MultipleFailureMechanismTypes_ThrowsNotSupportedException()
        {
            var hydraRingConfigurationService = new HydraRingConfigurationService(HydraRingUncertaintiesType.Model);
            var calculationInput1             = new HydraRingCalculationInputImplementation(1, 2);
            var calculationInput2             = new HydraRingCalculationInputImplementation(2, 3);

            calculationInput2.SetFailureMechanismType(HydraRingFailureMechanismType.DikeHeight);

            hydraRingConfigurationService.AddHydraRingCalculationInput(calculationInput1);

            // Call
            TestDelegate test = () => hydraRingConfigurationService.AddHydraRingCalculationInput(calculationInput2);

            // Assert
            const string expectedMessage = "Running calculations for multiple failure mechanism types is not supported.";
            var          exception       = Assert.Throws <NotSupportedException>(test);

            Assert.AreEqual(expectedMessage, exception.Message);
        }