public void PropertyAttributes_WithDikeHeightAndOvertoppingRateCalculated_ReturnExpectedValues() { // Setup var resultOutput = new OvertoppingOutput(10, true, 0, null); var dikeHeightOutput = new TestDikeHeightOutput(double.NaN); var overtoppingRateOutput = new TestOvertoppingRateOutput(double.NaN); var output = new GrassCoverErosionInwardsOutput(resultOutput, dikeHeightOutput, overtoppingRateOutput); // Call var properties = new GrassCoverErosionInwardsOutputProperties(output); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(16, dynamicProperties.Count); AssertResultOutputProperties(dynamicProperties); AssertDikeHeightOutputProperties(dynamicProperties, firstHydraulicLoadsOutputIndex); AssertOvertoppingRateOutputProperties(dynamicProperties, secondHydraulicLoadsOutputIndex); }
public void Constructor_ReferenceLineWithGeometry_PropertiesHaveExpectedAttributeValues() { // Call var properties = new ReferenceLineProperties(ReferenceLineTestFactory.CreateReferenceLineWithGeometry()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); const string generalCategoryName = "Algemeen"; PropertyDescriptor lengthProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lengthProperty, generalCategoryName, "Lengte* [m]", "Totale lengte van het traject in meters (afgerond).", true); PropertyDescriptor geometryProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(geometryProperty, generalCategoryName, "Coördinaten", "Lijst van alle coördinaten (X-coördinaat, Y-coördinaat) " + "die samen de referentielijn vormen.", true); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributeValues() { // Setup var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsWaterStressLinesProperties(input, new GeneralMacroStabilityInwardsInput(), AssessmentSectionTestHelper.GetTestAssessmentLevel()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); const string waterStressesCategoryName = "Waterspanningen"; PropertyDescriptor waternetExtremeProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetExtremeProperty, waterStressesCategoryName, "Extreme omstandigheden", "Eigenschappen van de waterspanningslijnen bij extreme omstandigheden.", true); PropertyDescriptor waternetDailyProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waternetDailyProperty, waterStressesCategoryName, "Dagelijkse omstandigheden", "Eigenschappen van de waterspanningslijnen bij dagelijkse omstandigheden.", true); }
private static void AssertPropertiesInState(VariationCoefficientLogNormalDistributionProperties properties, bool meanReadOnly, bool variationCoefficientReadOnly) { Assert.IsInstanceOf <VariationCoefficientDistributionPropertiesBase <VariationCoefficientLogNormalDistribution> >(properties); Assert.AreEqual("Lognormaal", properties.DistributionType); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); PropertyDescriptor distributionTypeProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(distributionTypeProperty, "Misc", "Type verdeling", "Het soort kansverdeling waarin deze parameter gedefinieerd wordt.", true); PropertyDescriptor meanProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(meanProperty, "Misc", "Verwachtingswaarde", "De gemiddelde waarde van de lognormale verdeling.", meanReadOnly); PropertyDescriptor variationCoefficientProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(variationCoefficientProperty, "Misc", "Variatiecoëfficiënt", "De variatiecoëfficiënt van de lognormale verdeling.", variationCoefficientReadOnly); }
public void Constructor_NoGeneralResult_PropertiesHaveExpectedAttributesValues() { // Setup var structuresOutput = new StructuresOutput(0, null); // Call var properties = new StructuresOutputProperties(structuresOutput); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, resultCategoryName, "Faalkans [1/jaar]", "De kans dat het faalmechanisme optreedt voor deze berekening.", true); PropertyDescriptor reliabilityProperty = dynamicProperties[reliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(reliabilityProperty, resultCategoryName, "Betrouwbaarheidsindex faalkans [-]", "De betrouwbaarheidsindex van de faalkans voor deze berekening.", true); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributeValues() { // Setup var mocks = new MockRepository(); var failureMechanism = mocks.StrictMock <ICalculatableFailureMechanism>(); mocks.ReplayAll(); // Call var properties = new CalculationGroupContextProperties(new TestCalculationGroupContext(new CalculationGroup(), new CalculationGroup(), failureMechanism)); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(1, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, "Algemeen", "Naam", "Naam van de map met berekeningen."); }
private static void AssertPropertiesInState(LogNormalDistributionProperties properties, bool meanReadOnly, bool deviationReadOnly) { PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); PropertyDescriptor distributionTypeProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(distributionTypeProperty, "Misc", "Type verdeling", "Het soort kansverdeling waarin deze parameter gedefinieerd wordt.", true); PropertyDescriptor meanProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(meanProperty, "Misc", "Verwachtingswaarde", "De gemiddelde waarde van de lognormale verdeling.", meanReadOnly); PropertyDescriptor standardDeviationProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(standardDeviationProperty, "Misc", "Standaardafwijking", "De standaardafwijking van de lognormale verdeling.", deviationReadOnly); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Setup var failureMechanism = new StabilityPointStructuresFailureMechanism(); // Call var properties = new TestStabilityPointStructuresFailureMechanismProperties(failureMechanism, new StabilityPointStructuresFailureMechanismPropertiesBase.ConstructionProperties { NamePropertyIndex = namePropertyIndex, CodePropertyIndex = codePropertyIndex }); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); const string generalCategory = "Algemeen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor labelProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(labelProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); }
public void Constructor_InAssemblyTrue_PropertiesHaveExpectedAttributesValues() { // Setup var failureMechanism = new PipingStructureFailureMechanism { InAssembly = true }; // Call var properties = new PipingStructureFailureMechanismProperties(failureMechanism); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor labelProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(labelProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, "In assemblage", "Geeft aan of dit faalmechanisme wordt meegenomen in de assemblage.", true); PropertyDescriptor nProperty = dynamicProperties[nPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nProperty, lengthEffectCategory, "N [-]", "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling."); PropertyDescriptor applySectionLengthInSectionProperty = dynamicProperties[applyLengthEffectInSectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(applySectionLengthInSectionProperty, lengthEffectCategory, "Toepassen lengte-effect binnen vak", "Geeft aan of het lengte-effect binnen een vak toegepast wordt.", true); }
private static void AssertPropertiesInState(object properties, bool expectedReadOnly) { PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); Assert.AreEqual(expectedReadOnly, dynamicProperties[1].IsReadOnly); Assert.AreEqual(expectedReadOnly, dynamicProperties[2].IsReadOnly); }
public void Constructor_ExpectedValues() { // Setup const string windDirection = "N"; const string closingSituation = "closing situation"; var illustrationPoint = new SubMechanismIllustrationPoint("Sub mechanism A", 5.4, new[] { new SubMechanismIllustrationPointStochast("Test", "-", 2.0, 4.5, 0.1) }, new[] { new IllustrationPointResult("result A", "-", 2.3) }); // Call var properties = new SubMechanismIllustrationPointProperties(illustrationPoint, windDirection, closingSituation); // Assert Assert.IsInstanceOf <IllustrationPointProperties>(properties); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); PropertyDescriptor alphasProperty = dynamicProperties[alphasPropertyIndex]; Assert.NotNull(alphasProperty.Attributes[typeof(KeyValueElementAttribute)]); PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; Assert.NotNull(durationsProperty.Attributes[typeof(KeyValueElementAttribute)]); Assert.AreEqual(windDirection, properties.WindDirection); TestHelper.AssertTypeConverter <SubMechanismIllustrationPointProperties, NoValueRoundedDoubleConverter>( nameof(SubMechanismIllustrationPointProperties.Reliability)); Assert.AreEqual(illustrationPoint.Beta, properties.Reliability, properties.Reliability.GetAccuracy()); Assert.AreEqual(5, properties.Reliability.NumberOfDecimalPlaces); TestHelper.AssertTypeConverter <SubMechanismIllustrationPointProperties, NoProbabilityValueDoubleConverter>( nameof(SubMechanismIllustrationPointProperties.CalculatedProbability)); Assert.AreEqual(StatisticsConverter.ReliabilityToProbability(illustrationPoint.Beta), properties.CalculatedProbability); Assert.AreEqual(closingSituation, properties.ClosingSituation); TestHelper.AssertTypeConverter <SubMechanismIllustrationPointProperties, KeyValueExpandableArrayConverter>( nameof(SubMechanismIllustrationPointProperties.AlphaValues)); CollectionAssert.AreEqual(illustrationPoint.Stochasts, properties.AlphaValues); TestHelper.AssertTypeConverter <SubMechanismIllustrationPointProperties, KeyValueExpandableArrayConverter>( nameof(SubMechanismIllustrationPointProperties.Durations)); CollectionAssert.AreEqual(illustrationPoint.Stochasts, properties.Durations); TestHelper.AssertTypeConverter <SubMechanismIllustrationPointProperties, ExpandableObjectConverter>( nameof(SubMechanismIllustrationPointProperties.SubMechanismIllustrationPointValues)); Assert.AreSame(illustrationPoint, properties.SubMechanismIllustrationPointValues.Data); }
public void VisibleProperties_WithSoilProfile1D_ExpectedAttributesValues() { // Setup var layer = new MacroStabilityInwardsSoilLayer1D(-2); var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.142, new MacroStabilityInwardsSoilProfile1D("<some name>", -5.0, new[] { layer })); // Call var properties = new MacroStabilityInwardsStochasticSoilProfileProperties(stochasticSoilProfile); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategoryName, "Naam", "De naam van de ondergrondschematisatie.", true); PropertyDescriptor contributionProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty, generalCategoryName, "Aandeel [%]", "Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel.", true); PropertyDescriptor layersProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(layersProperty, generalCategoryName, "Grondlagen", "", true); PropertyDescriptor bottomProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(bottomProperty, generalCategoryName, "Bodemniveau", "Het niveau van de onderkant van de ondergrondschematisatie.", true); PropertyDescriptor typeProperty = dynamicProperties[4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(typeProperty, generalCategoryName, "Type", "Het type van de ondergrondschematisatie.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var pipingStochasticSoilProfile = new PipingStochasticSoilProfile(0.0, new PipingSoilProfile("", 0.0, new[] { new PipingSoilLayer(10.0) }, SoilProfileType.SoilProfile1D)); // Call var properties = new PipingStochasticSoilProfileProperties(pipingStochasticSoilProfile); // Assert const string generalCategoryName = "Algemeen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategoryName, "Naam", "De naam van de ondergrondschematisatie.", true); PropertyDescriptor contributionProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty, generalCategoryName, "Aandeel [%]", "Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel.", true); PropertyDescriptor layersProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(layersProperty, generalCategoryName, "Grondlagen", "", true); PropertyDescriptor bottomProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(bottomProperty, generalCategoryName, "Bodemniveau", "Het niveau van de onderkant van de ondergrondschematisatie.", true); PropertyDescriptor typeProperty = dynamicProperties[4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(typeProperty, generalCategoryName, "Type", "Het type van de ondergrondschematisatie.", true); }
public void Constructor_MapPointDataWithoutMapTheme_PropertiesHaveExpectedAttributesValues() { // Setup var mapPointData = new MapPointData("Test") { Features = new[] { new MapFeature(Enumerable.Empty <MapGeometry>()) }, ShowLabels = true }; // Call var properties = new MapPointDataProperties(mapPointData, Enumerable.Empty <MapDataCollection>()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(11, dynamicProperties.Count); const string styleCategory = "Stijl"; PropertyDescriptor colorProperty = dynamicProperties[colorPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(colorProperty, styleCategory, "Kleur", "De kleur van de symbolen waarmee deze kaartlaag wordt weergegeven."); PropertyDescriptor strokeColorProperty = dynamicProperties[strokeColorPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeColorProperty, styleCategory, "Lijnkleur", "De kleur van de lijn van de symbolen waarmee deze kaartlaag wordt weergegeven."); PropertyDescriptor strokeThicknessProperty = dynamicProperties[strokeThicknessPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeThicknessProperty, styleCategory, "Lijndikte", "De dikte van de lijn van de symbolen waarmee deze kaartlaag wordt weergegeven."); PropertyDescriptor sizeProperty = dynamicProperties[sizePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sizeProperty, styleCategory, "Grootte", "De grootte van de symbolen waarmee deze kaartlaag wordt weergegeven."); PropertyDescriptor symbolProperty = dynamicProperties[symbolPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(symbolProperty, styleCategory, "Symbool", "Het symbool waarmee deze kaartlaag wordt weergegeven."); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); // Call var properties = new FailureMechanismSectionProperties(section, double.NaN, double.NaN); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, "Algemeen", "Vaknaam", "De naam van het vak.", true); PropertyDescriptor sectionStartDistanceProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sectionStartDistanceProperty, "Algemeen", "Metrering van* [m]", "De afstand tussen het beginpunt van het vak en het begin van het traject, gemeten langs het traject in meters (afgerond).", true); PropertyDescriptor sectionEndDistanceProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sectionEndDistanceProperty, "Algemeen", "Metrering tot* [m]", "De afstand tussen het eindpunt van het vak en het begin van het traject, gemeten langs het traject in meters (afgerond).", true); PropertyDescriptor lengthProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lengthProperty, "Algemeen", "Lengte* [m]", "De totale lengte van het vak in meters (afgerond).", true); PropertyDescriptor startPointProperty = dynamicProperties[4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(startPointProperty, "Algemeen", "Beginpunt", "Beginpunt van het vak (X-coördinaat, Y-coördinaat).", true); PropertyDescriptor endPointProperty = dynamicProperties[5]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(endPointProperty, "Algemeen", "Eindpunt", "Eindpunt van het vak (X-coördinaat, Y-coördinaat).", true); }
public void PropertyAttributes_NoGeneralResult_ReturnExpectedValues(double waveHeight) { // Setup var overtoppingOutput = new OvertoppingOutput(waveHeight, true, 0, null); // Call var properties = new OvertoppingOutputProperties(overtoppingOutput); // Assert int propertiesCount = overtoppingOutput.HasWaveHeight ? 4 : 3; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(propertiesCount, dynamicProperties.Count); PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, resultCategoryName, "Faalkans [1/jaar]", "De kans dat het faalmechanisme optreedt voor deze berekening.", true); PropertyDescriptor reliabilityProperty = dynamicProperties[reliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(reliabilityProperty, resultCategoryName, "Betrouwbaarheidsindex faalkans [-]", "De betrouwbaarheidsindex van de faalkans voor deze berekening.", true); if (overtoppingOutput.HasWaveHeight) { PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, resultCategoryName, "Indicatieve golfhoogte (Hs) [m]", "De golfhoogte van de overslag deelberekening.", true); } int waveHeightNotPresentOffset = overtoppingOutput.HasWaveHeight ? 0 : 1; PropertyDescriptor isDominantProperty = dynamicProperties[isDominantIndex - waveHeightNotPresentOffset]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(isDominantProperty, resultCategoryName, "Overslag dominant [-]", "Is het resultaat van de overslag deelberekening dominant over de overloop deelberekening.", true); }
public void VisibleProperties_WithSoilProfile2D_ExpectedAttributesValues() { // Setup var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.142, new MacroStabilityInwardsSoilProfile2D("<some name>", new[] { CreateMacroStabilityInwardsSoilLayer2D() }, Enumerable.Empty <MacroStabilityInwardsPreconsolidationStress>())); // Call var properties = new MacroStabilityInwardsStochasticSoilProfileProperties(stochasticSoilProfile); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategoryName, "Naam", "De naam van de ondergrondschematisatie.", true); PropertyDescriptor contributionProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(contributionProperty, generalCategoryName, "Aandeel [%]", "Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel.", true); PropertyDescriptor layersProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(layersProperty, generalCategoryName, "Grondlagen", "", true); PropertyDescriptor typeProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(typeProperty, generalCategoryName, "Type", "Het type van de ondergrondschematisatie.", true); PropertyDescriptor preconsolidationProperty = dynamicProperties[4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(preconsolidationProperty, generalCategoryName, "Grensspanningen", "De grensspanningen in de ondergrondschematisatie.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Call var properties = new GrassCoverErosionOutwardsFailureMechanismProperties(new GrassCoverErosionOutwardsFailureMechanism()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor codeProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor waveRunUpProperty = dynamicProperties[waveRunUpPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(waveRunUpProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveRunUpProperty, modelSettingsCategory, "Golfoploop", "De modelinstellingen voor het berekenen van golfcondities voor golfoploop.", true); PropertyDescriptor waveImpactProperty = dynamicProperties[waveImpactPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(waveImpactProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveImpactProperty, modelSettingsCategory, "Golfklap", "De modelinstellingen voor het berekenen van golfcondities voor golfklap zonder invloed van de golfinvalshoek.", true); PropertyDescriptor waveImpactWithWaveDirectionProperty = dynamicProperties[waveImpactWithWaveDirectionPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(waveImpactWithWaveDirectionProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveImpactWithWaveDirectionProperty, modelSettingsCategory, "Golfklap met golfrichting", "De modelinstellingen voor het berekenen van golfcondities voor golfklap met invloed van de golfinvalshoek.", true); }
public void Constructor_ReferenceLineWithoutGeometry_PropertiesHaveExpectedAttributeValues() { // Call var properties = new ReferenceLineProperties(new ReferenceLine()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(0, dynamicProperties.Count); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Call var properties = new HeightStructuresFailureMechanismProperties(new HeightStructuresFailureMechanism()); // Assert const string generalCategory = "Algemeen"; const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor codeProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor gravitationalAccelerationProperty = dynamicProperties[gravitationalAccelerationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(gravitationalAccelerationProperty, generalCategory, "Valversnelling [m/s²]", "Valversnelling.", true); PropertyDescriptor modelFactorOvertoppingFlowProperty = dynamicProperties[modelFactorOvertoppingFlowPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(modelFactorOvertoppingFlowProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorOvertoppingFlowProperty, modelSettingsCategory, "Modelfactor overslagdebiet [-]", "Modelfactor voor het overslagdebiet.", true); PropertyDescriptor modelFactorStorageVolumeProperty = dynamicProperties[modelFactorStorageVolumePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(modelFactorStorageVolumeProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorStorageVolumeProperty, modelSettingsCategory, "Modelfactor kombergend vermogen [-]", "Modelfactor kombergend vermogen.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Call var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(new WaveImpactAsphaltCoverFailureMechanism()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor codeProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor aProperty = dynamicProperties[aPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(aProperty, modelSettingsCategory, "a", "De waarde van de parameter 'a' in de berekening voor golfcondities.", true); PropertyDescriptor bProperty = dynamicProperties[bPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(bProperty, modelSettingsCategory, "b", "De waarde van de parameter 'b' in de berekening voor golfcondities.", true); PropertyDescriptor cProperty = dynamicProperties[cPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(cProperty, modelSettingsCategory, "c", "De waarde van de parameter 'c' in de berekening voor golfcondities.", true); }
public void Constructor_CalculationTypeBlocksOrColumns_PropertiesHaveExpectedAttributesValues(StabilityStoneCoverWaveConditionsCalculationType calculationType) { // Setup var blocksOutput = new[] { new TestWaveConditionsOutput() }; var columnsOutput = new[] { new TestWaveConditionsOutput() }; StabilityStoneCoverWaveConditionsOutput stabilityStoneCoverWaveConditionsOutput = StabilityStoneCoverWaveConditionsOutputTestFactory.Create( columnsOutput, blocksOutput); var input = new StabilityStoneCoverWaveConditionsInput { CalculationType = calculationType }; // Call var properties = new StabilityStoneCoverWaveConditionsOutputProperties( stabilityStoneCoverWaveConditionsOutput, input); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(1, dynamicProperties.Count); const string resultCategory = "Resultaat"; string revetmentType = null; if (calculationType == StabilityStoneCoverWaveConditionsCalculationType.Blocks) { revetmentType = "blokken"; } if (calculationType == StabilityStoneCoverWaveConditionsCalculationType.Columns) { revetmentType = "zuilen"; } PropertyDescriptor outputProperty = dynamicProperties[0]; Assert.IsInstanceOf <ExpandableArrayConverter>(outputProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(outputProperty, resultCategory, $"Hydraulische belastingen voor {revetmentType}", $"Berekende hydraulische belastingen voor {revetmentType}.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var mockRepository = new MockRepository(); var handler = mockRepository.Stub <IObservablePropertyChangeHandler>(); mockRepository.ReplayAll(); var distribution = new NormalDistribution(); var designVariable = new NormalDistributionDesignVariable(distribution); // Call var properties = new NormalDistributionDesignVariableProperties(DistributionReadOnlyProperties.None, designVariable, handler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(4, dynamicProperties.Count); PropertyDescriptor distributionTypeProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(distributionTypeProperty, "Misc", "Type verdeling", "Het soort kansverdeling waarin deze parameter gedefinieerd wordt.", true); PropertyDescriptor meanProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(meanProperty, "Misc", "Verwachtingswaarde", "De gemiddelde waarde van de normale verdeling."); PropertyDescriptor standardDeviationProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(standardDeviationProperty, "Misc", "Standaardafwijking", "De standaardafwijking van de normale verdeling."); PropertyDescriptor designValueProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(designValueProperty, "Misc", "Rekenwaarde", "De representatieve waarde die gebruikt wordt door de berekening.", true); mockRepository.VerifyAll(); }
public void Constructor_WithValidArguments_PropertiesHaveExpectedAttributeValues() { // Setup var categoryTheme = new PointCategoryTheme(ValueCriterionTestFactory.CreateValueCriterion(), new PointStyle()); // Call var properties = new PointCategoryThemeProperties(categoryTheme, string.Empty, new MapPointData("Name")); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); const string styleCategory = "Stijl"; PropertyDescriptor colorProperty = dynamicProperties[colorPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(colorProperty, styleCategory, "Kleur", "De kleur van de symbolen waarmee deze categorie wordt weergegeven."); PropertyDescriptor strokeColorProperty = dynamicProperties[strokeColorPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeColorProperty, styleCategory, "Lijnkleur", "De kleur van de lijn van de symbolen waarmee deze categorie wordt weergegeven."); PropertyDescriptor strokeThicknessProperty = dynamicProperties[strokeThicknessPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeThicknessProperty, styleCategory, "Lijndikte", "De dikte van de lijn van de symbolen waarmee deze categorie wordt weergegeven."); PropertyDescriptor sizeProperty = dynamicProperties[sizePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sizeProperty, styleCategory, "Grootte", "De grootte van de symbolen waarmee deze categorie wordt weergegeven."); PropertyDescriptor symbolProperty = dynamicProperties[symbolPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(symbolProperty, styleCategory, "Symbool", "Het symbool waarmee deze categorie wordt weergegeven."); }
public void Constructor_InAssemblyFalse_PropertiesHaveExpectedAttributesValues() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub <IAssessmentSection>(); mocks.ReplayAll(); var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism { InAssembly = false }; // Call var properties = new WaveImpactAsphaltCoverFailureMechanismProperties(failureMechanism, assessmentSection); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); const string generalCategory = "Algemeen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor codeProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, "In assemblage", "Geeft aan of dit faalmechanisme wordt meegenomen in de assemblage.", true); mocks.VerifyAll(); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributesValues() { // Setup var mocks = new MockRepository(); var changeHandler = mocks.Stub <IObservablePropertyChangeHandler>(); mocks.ReplayAll(); var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsDrainageProperties(input, changeHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); const string drainageCategory = "Drainage"; PropertyDescriptor drainagePresentProperty = dynamicProperties[expectedDrainageConstructionPresentPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( drainagePresentProperty, drainageCategory, "Aanwezig", "Is drainage aanwezig?", true); PropertyDescriptor drainageXProperty = dynamicProperties[expectedXCoordinateDrainageConstructionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( drainageXProperty, drainageCategory, "X [m]", "X-coördinaat van het middelpunt van de drainage (in lokale coördinaten).", true); PropertyDescriptor drainageZProperty = dynamicProperties[expectedZCoordinateDrainageConstructionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( drainageZProperty, drainageCategory, "Z [m+NAP]", "Z-coördinaat (hoogte) van het middelpunt van de drainage.", true); mocks.VerifyAll(); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributesValues() { // Setup var mocks = new MockRepository(); var changeHandler = mocks.Stub <IObservablePropertyChangeHandler>(); mocks.ReplayAll(); var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsLocationInputExtremeProperties(input, changeHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); const string waterStressesCategory = "Waterspanningen"; PropertyDescriptor waterLevelPolderProperty = dynamicProperties[expectedWaterLevelPolderPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( waterLevelPolderProperty, waterStressesCategory, "Polderpeil [m+NAP]", "Het niveau van het oppervlaktewater binnen een beheersgebied."); PropertyDescriptor offsetProperty = dynamicProperties[expectedOffsetPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( offsetProperty, waterStressesCategory, "Offsets PL 1", "Eigenschappen van offsets PL 1.", true); PropertyDescriptor penetrationLengthProperty = dynamicProperties[expectedPenetrationLengthPropertyIndex]; Assert.IsNotNull(penetrationLengthProperty.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( penetrationLengthProperty, waterStressesCategory, "Indringingslengte [m]", "De verticale afstand waarover de waterspanning in de deklaag verandert bij waterspanningsvariaties in de watervoerende zandlaag."); mocks.VerifyAll(); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Setup var failureMechanism = new StabilityStoneCoverFailureMechanism(); // Call var properties = new StabilityStoneCoverFailureMechanismProperties(failureMechanism); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(4, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string modelSettingsCateogry = "Modelinstellingen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor codeProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor blocksProperty = dynamicProperties[blocksPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(blocksProperty, modelSettingsCateogry, "Blokken", "De modelinstellingen voor het berekenen van golfcondities voor blokken.", true); PropertyDescriptor columnsProperty = dynamicProperties[columnsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(columnsProperty, modelSettingsCateogry, "Zuilen", "De modelinstellingen voor het berekenen van golfcondities voor zuilen.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Setup var failureMechanism = new MacroStabilityInwardsFailureMechanism(); // Call var properties = new MacroStabilityInwardsFailureMechanismProperties(failureMechanism); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(4, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string modelFactorCategory = "Modelinstellingen"; PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het faalmechanisme.", true); PropertyDescriptor labelProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(labelProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); PropertyDescriptor volumicWeightOfWaterProperty = dynamicProperties[waterVolumetricWeightPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(volumicWeightOfWaterProperty, generalCategory, "Volumiek gewicht van water [kN/m³]", "Volumiek gewicht van water.", true); PropertyDescriptor modelFactorProperty = dynamicProperties[modelFactorPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorProperty, modelFactorCategory, "Modelfactor [-]", "Modelfactor die wordt gebruikt bij de berekening van de benaderde faalkans op basis van de berekende stabiliteitsfactor.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues(bool isStyleEditable) { // Setup var chartAreaData = new ChartMultipleAreaData("Test", new ChartAreaStyle { IsEditable = isStyleEditable }); // Call var properties = new ChartMultipleAreaDataProperties { Data = chartAreaData }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); const string styleCategory = "Stijl"; PropertyDescriptor fillColorProperty = dynamicProperties[fillColorPropertyIndex]; Assert.IsInstanceOf <ColorTypeConverter>(fillColorProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(fillColorProperty, styleCategory, "Kleur", "De kleur van de vlakken waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); PropertyDescriptor strokeColorProperty = dynamicProperties[strokeColorPropertyIndex]; Assert.IsInstanceOf <ColorTypeConverter>(strokeColorProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeColorProperty, styleCategory, "Lijnkleur", "De kleur van de lijn van de vlakken waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); PropertyDescriptor strokeThicknessProperty = dynamicProperties[strokeThicknessPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeThicknessProperty, styleCategory, "Lijndikte", "De dikte van de lijn van de vlakken waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); }