public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Call var properties = new ClosingStructuresFailureMechanismProperties(new ClosingStructuresFailureMechanism()); // Assert const string generalCategory = "Algemeen"; const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(7, 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); PropertyDescriptor modelFactorLongThresholdProperty = dynamicProperties[modelFactorLongThresholdPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(modelFactorLongThresholdProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorLongThresholdProperty, modelSettingsCategory, "Modelfactor lange overlaat [-]", "Modelfactor voor een lange overlaat.", true); PropertyDescriptor modelFactorInflowVolumeProperty = dynamicProperties[modelFactorInflowVolumePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorInflowVolumeProperty, modelSettingsCategory, "Modelfactor instromend volume [-]", "Modelfactor instromend volume.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Setup var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call var properties = new GrassCoverErosionInwardsFailureMechanismProperties( failureMechanism); // Assert const string generalCategory = "Algemeen"; const string modelSettingsCategory = "Modelinstellingen"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, 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 frunupModelFactorProperty = dynamicProperties[frunupModelFactorPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(frunupModelFactorProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(frunupModelFactorProperty, modelSettingsCategory, "Modelfactor Frunup [-]", "De parameter 'Frunup' die gebruikt wordt in de berekening.", true); PropertyDescriptor fbModelProperty = dynamicProperties[fbFactorPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(fbModelProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(fbModelProperty, modelSettingsCategory, "Modelfactor Fb [-]", "De parameter 'Fb' die gebruikt wordt in de berekening.", true); PropertyDescriptor fnFactorProperty = dynamicProperties[fnFactorPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(fnFactorProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(fnFactorProperty, modelSettingsCategory, "Modelfactor Fn [-]", "De parameter 'Fn' die gebruikt wordt in de berekening.", true); PropertyDescriptor fshallowProperty = dynamicProperties[fshallowModelFactorPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(fshallowProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(fshallowProperty, modelSettingsCategory, "Modelfactor Fondiep [-]", "De parameter 'Fondiep' die gebruikt wordt in de berekening.", true); }
public void Constructor_InAssemblyTrue_PropertiesHaveExpectedAttributesValues() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub <IAssessmentSection>(); mocks.ReplayAll(); var failureMechanism = new PipingFailureMechanism(); // Call var properties = new PipingFailureMechanismProperties(failureMechanism, assessmentSection); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(8, 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 aProperty = dynamicProperties[aPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(aProperty, lengthEffectCategory, "a [-]", "De parameter 'a' die gebruikt wordt voor het lengte-effect in berekening van de maximaal toelaatbare faalkans."); PropertyDescriptor bProperty = dynamicProperties[bPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(bProperty, lengthEffectCategory, "b [m]", "De parameter 'b' die gebruikt wordt voor het lengte-effect in berekening van de maximaal toelaatbare faalkans.", true); PropertyDescriptor sectionLengthProperty = dynamicProperties[sectionLengthPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sectionLengthProperty, lengthEffectCategory, "Lengte* [m]", "Totale lengte van het traject in meters (afgerond).", 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 (afgerond).", true); 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); mocks.VerifyAll(); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var surfaceLine = new PipingSurfaceLine(string.Empty); // Call var properties = new PipingSurfaceLineProperties { Data = surfaceLine }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(8, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string charactersticPointsCategory = "Karakteristieke punten"; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[0], generalCategory, "Naam", "Naam van de profielschematisatie.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[1], generalCategory, "Geometriepunten", "De punten die de geometrie van de profielschematisatie definiëren.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[2], charactersticPointsCategory, "Teen dijk buitenwaarts", "De locatie van de teen van de dijk wanneer de dijk van buiten de polder wordt benaderd.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[3], charactersticPointsCategory, "Teen dijk binnenwaarts", "De locatie van de teen van de dijk wanneer de dijk van binnen de polder wordt benaderd.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[4], charactersticPointsCategory, "Insteek sloot dijkzijde", "De locatie van het begin van de sloot wanneer deze van de kant van de dijk wordt benaderd.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[5], charactersticPointsCategory, "Slootbodem dijkzijde", "De locatie van het begin van de slootbodem wanneer deze van de kant van de dijk wordt benaderd.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[6], charactersticPointsCategory, "Slootbodem polderzijde", "De locatie van het begin van de slootbodem wanneer deze van binnen de polder wordt benaderd.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( dynamicProperties[7], charactersticPointsCategory, "Insteek sloot polderzijde", "De locatie van het begin van de sloot wanneer deze van binnen de polder wordt benaderd.", true); }
public void VisibleProperties_WithChildIllustrationPointNodes_ExpectedAttributesValues() { // Setup var illustrationPoint = new TestFaultTreeIllustrationPoint(); var childNodes = new[] { new IllustrationPointNode(new TestSubMechanismIllustrationPoint("A")), new IllustrationPointNode(new TestSubMechanismIllustrationPoint("B")) }; // Call var properties = new FaultTreeIllustrationPointProperties(illustrationPoint, childNodes, "N", "Regular"); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(7, dynamicProperties.Count); const string illustrationPointsCategoryName = "Illustratiepunten"; PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, illustrationPointsCategoryName, "Berekende kans [-]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor reliabilityProperty = dynamicProperties[reliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(reliabilityProperty, illustrationPointsCategoryName, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, illustrationPointsCategoryName, "Windrichting", "De windrichting waarvoor dit illlustratiepunt is berekend.", true); PropertyDescriptor closingScenarioProperty = dynamicProperties[closingScenarioPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(closingScenarioProperty, illustrationPointsCategoryName, "Keringsituatie", "De keringsituatie waarvoor dit illustratiepunt is berekend.", true); PropertyDescriptor alphasProperty = dynamicProperties[alphasPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphasProperty, illustrationPointsCategoryName, "Invloedscoëfficiënten [-]", "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", true); PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, illustrationPointsCategoryName, "Tijdsduren [uur]", "Tijdsduren waarop de stochasten betrekking hebben.", true); PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(illustrationPointProperty, illustrationPointsCategoryName, "Illustratiepunten", "De lijst van illustratiepunten voor de berekening.", true); }
public void Constructor_WithLinkedDatabaseStatus_HlcdFilePathHaveExpectedAttributeValue(bool isLinked) { // Setup var mocks = new MockRepository(); var importHandler = mocks.Stub <IHydraulicLocationConfigurationDatabaseImportHandler>(); mocks.ReplayAll(); HydraulicBoundaryDatabase hydraulicBoundaryDatabase = isLinked ? CreateLinkedHydraulicBoundaryDatabase() : new HydraulicBoundaryDatabase(); // Call var properties = new HydraulicBoundaryDatabaseProperties(hydraulicBoundaryDatabase, importHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(12, dynamicProperties.Count); const string expectedCategory = "Algemeen"; PropertyDescriptor hrdFilePathProperty = dynamicProperties[hrdFilePathPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(hrdFilePathProperty, expectedCategory, "HRD bestandslocatie", "Locatie van het HRD bestand.", true); PropertyDescriptor hlcdFilePathProperty = dynamicProperties[hlcdFilePathPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(hlcdFilePathProperty, expectedCategory, "HLCD bestandslocatie", "Locatie van het HLCD bestand.", !isLinked); if (isLinked) { object hlcdFilePathEditor = hlcdFilePathProperty.GetEditor(typeof(UITypeEditor)); Assert.IsInstanceOf <HlcdFileNameEditor>(hlcdFilePathEditor); } PropertyDescriptor usePreprocessorClosureProperty = dynamicProperties[usePreprocessorClosurePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(usePreprocessorClosureProperty, expectedCategory, "Gebruik preprocessor sluitregime database", "Gebruik de preprocessor sluitregime database bij het uitvoeren van een berekening.", true); PropertyDescriptor scenarioNameProperty = dynamicProperties[scenarioNamePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(scenarioNameProperty, expectedCategory, "Klimaatscenario", "Algemene naam van het klimaatscenario.", true); PropertyDescriptor yearProperty = dynamicProperties[yearPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(yearProperty, expectedCategory, "Zichtjaar", "Jaartal van het jaar waarop de statistiek van toepassing is.", true); PropertyDescriptor scopeProperty = dynamicProperties[scopePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(scopeProperty, expectedCategory, "Toepassingskader", "Projectkader waarin de statistiek bedoeld is te gebruiken.", true); PropertyDescriptor seaLevelProperty = dynamicProperties[seaLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(seaLevelProperty, expectedCategory, "Zeewaterstand", "Klimaatinformatie met betrekking tot de zeewaterstand.", true); PropertyDescriptor riverDischargeProperty = dynamicProperties[riverDischargePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(riverDischargeProperty, expectedCategory, "Rivierafvoer", "Klimaatinformatie met betrekking tot de rivierafvoer.", true); PropertyDescriptor lakeLevelProperty = dynamicProperties[lakeLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lakeLevelProperty, expectedCategory, "Meerpeil", "Klimaatinformatie met betrekking tot het meerpeil/de meerpeilen.", true); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, expectedCategory, "Windrichting", "Klimaatinformatie met betrekking tot de windrichting.", true); PropertyDescriptor windSpeedProperty = dynamicProperties[windSpeedPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windSpeedProperty, expectedCategory, "Windsnelheid", "Klimaatinformatie met betrekking tot de windsnelheid.", true); PropertyDescriptor commentProperty = dynamicProperties[commentPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(commentProperty, expectedCategory, "Overig", "Overige informatie.", true); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributesValues() { // Setup var mocks = new MockRepository(); var propertyChangeHandler = mocks.Stub <IObservablePropertyChangeHandler>(); mocks.ReplayAll(); var input = new MacroStabilityInwardsInput(new MacroStabilityInwardsInput.ConstructionProperties()); // Call var properties = new MacroStabilityInwardsWaterStressesProperties(input, new GeneralMacroStabilityInwardsInput(), AssessmentSectionTestHelper.GetTestAssessmentLevel(), propertyChangeHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(14, dynamicProperties.Count); const string waterStressesCategory = "Waterspanningen"; PropertyDescriptor waterLevelRiverAverageProperty = dynamicProperties[expectedWaterLevelRiverAveragePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( waterLevelRiverAverageProperty, waterStressesCategory, "Gemiddeld hoog water (GHW) [m+NAP]", "Gemiddeld hoog water."); PropertyDescriptor drainageProperty = dynamicProperties[expectedDrainagePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( drainageProperty, waterStressesCategory, "Drainage", "Eigenschappen van drainage constructie.", true); PropertyDescriptor minimumLevelPhreaticLineAtDikeTopRiverProperty = dynamicProperties[expectedMinimumLevelPhreaticLineAtDikeTopRiverPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( minimumLevelPhreaticLineAtDikeTopRiverProperty, waterStressesCategory, "PL 1 initiële hoogte onder buitenkruin [m+NAP]", "Minimale hoogte van de freatische lijn onder kruin buitentalud."); PropertyDescriptor minimumLevelPhreaticLineAtDikeTopPolderProperty = dynamicProperties[expectedMinimumLevelPhreaticLineAtDikeTopPolderPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( minimumLevelPhreaticLineAtDikeTopPolderProperty, waterStressesCategory, "PL 1 initiële hoogte onder binnenkruin [m+NAP]", "Minimale hoogte van de freatische lijn onder kruin binnentalud."); PropertyDescriptor adjustPhreaticLine3And4ForUpliftProperty = dynamicProperties[expectedAdjustPhreaticLine3And4ForUpliftPropertyIndex]; Assert.NotNull(adjustPhreaticLine3And4ForUpliftProperty.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( adjustPhreaticLine3And4ForUpliftProperty, waterStressesCategory, "Corrigeer PL 3 en PL 4 voor opbarsten", "Corrigeer de stijghoogte in watervoerende zandlaag en tussenzandlaag voor opbarsten?"); PropertyDescriptor leakageLengthOutwardsPhreaticLine3Property = dynamicProperties[expectedLeakageLengthOutwardsPhreaticLine3PropertyIndex]; Assert.NotNull(leakageLengthOutwardsPhreaticLine3Property.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( leakageLengthOutwardsPhreaticLine3Property, waterStressesCategory, "Leklengte buitenwaarts PL 3 [m]", "Lengtemaat die uitdrukking geeft aan de afstand waarover de stijghoogte verloopt in de diepe watervoerende zandlaag ter hoogte van het voorland."); PropertyDescriptor leakageLengthInwardsPhreaticLine3Property = dynamicProperties[expectedLeakageLengthInwardsPhreaticLine3PropertyIndex]; Assert.NotNull(leakageLengthInwardsPhreaticLine3Property.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( leakageLengthInwardsPhreaticLine3Property, waterStressesCategory, "Leklengte binnenwaarts PL 3 [m]", "Lengtemaat die uitdrukking geeft aan de afstand waarover de stijghoogte verloopt in de diepe watervoerende zandlaag ter hoogte van het achterland."); PropertyDescriptor leakageLengthOutwardsPhreaticLine4Property = dynamicProperties[expectedLeakageLengthOutwardsPhreaticLine4PropertyIndex]; Assert.NotNull(leakageLengthOutwardsPhreaticLine4Property.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( leakageLengthOutwardsPhreaticLine4Property, waterStressesCategory, "Leklengte buitenwaarts PL 4 [m]", "Lengtemaat die uitdrukking geeft aan de afstand waarover de stijghoogte verloopt in de tussenzandlaag ter hoogte van het voorland."); PropertyDescriptor leakageLengthInwardsPhreaticLine4Property = dynamicProperties[expectedLeakageLengthInwardsPhreaticLine4PropertyIndex]; Assert.NotNull(leakageLengthInwardsPhreaticLine4Property.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( leakageLengthInwardsPhreaticLine4Property, waterStressesCategory, "Leklengte binnenwaarts PL 4 [m]", "Lengtemaat die uitdrukking geeft aan de afstand waarover de stijghoogte verloopt in de tussenzandlaag ter hoogte van het achterland."); PropertyDescriptor piezometricHeadPhreaticLine2OutwardsProperty = dynamicProperties[expectedPiezometricHeadPhreaticLine2OutwardsPropertyIndex]; Assert.NotNull(piezometricHeadPhreaticLine2OutwardsProperty.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( piezometricHeadPhreaticLine2OutwardsProperty, waterStressesCategory, "Stijghoogte PL 2 buitenwaarts [m+NAP]", "Stijghoogte in de indringingslaag buitenwaarts."); PropertyDescriptor piezometricHeadPhreaticLine2InwardsProperty = dynamicProperties[expectedPiezometricHeadPhreaticLine2InwardsPropertyIndex]; Assert.NotNull(piezometricHeadPhreaticLine2InwardsProperty.Attributes[typeof(DynamicReadOnlyAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( piezometricHeadPhreaticLine2InwardsProperty, waterStressesCategory, "Stijghoogte PL 2 binnenwaarts [m+NAP]", "Stijghoogte in de indringingslaag binnenwaarts."); PropertyDescriptor locationExtremeProperty = dynamicProperties[locationExtremePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( locationExtremeProperty, waterStressesCategory, "Extreme omstandigheden", "Eigenschappen van de waterspanningen bij extreme omstandigheden.", true); PropertyDescriptor locationDailyProperty = dynamicProperties[locationDailyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( locationDailyProperty, waterStressesCategory, "Dagelijkse omstandigheden", "Eigenschappen van de waterspanningen bij dagelijkse omstandigheden.", true); PropertyDescriptor waterStressLinesProperty = dynamicProperties[waterStressLinesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( waterStressLinesProperty, waterStressesCategory, "Waterspanningslijnen", "Eigenschappen van de waterspanningslijnen.", true); mocks.VerifyAll(); }
public void PropertyAttributes_NoGeneralResult_ReturnExpectedValues() { // Setup var overtoppingRateOutput = new TestOvertoppingRateOutput(10); // Call var properties = new OvertoppingRateOutputProperties(overtoppingRateOutput); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); PropertyDescriptor overtoppingRateProperty = dynamicProperties[overtoppingRatePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateProperty, overtoppingRateCategoryName, "Overslagdebiet [l/m/s]", "Het berekende overslagdebiet.", true); PropertyDescriptor targetProbability = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbability, overtoppingRateCategoryName, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliability = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliability, overtoppingRateCategoryName, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbability = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbability, overtoppingRateCategoryName, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliability = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliability, overtoppingRateCategoryName, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculationConvergence = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculationConvergence, overtoppingRateCategoryName, "Convergentie", "Is convergentie bereikt in de overslagdebiet berekening?", true); }
public void PropertyAttributes_HasGeneralResult_ReturnExpectedValues() { // Setup var overtoppingRateOutput = new TestOvertoppingRateOutput(new TestGeneralResultFaultTreeIllustrationPoint()); // Call var properties = new OvertoppingRateOutputProperties(overtoppingRateOutput); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(10, dynamicProperties.Count); PropertyDescriptor overtoppingRateProperty = dynamicProperties[overtoppingRatePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(overtoppingRateProperty, overtoppingRateCategoryName, "Overslagdebiet [l/m/s]", "Het berekende overslagdebiet.", true); PropertyDescriptor targetProbability = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbability, overtoppingRateCategoryName, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliability = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliability, overtoppingRateCategoryName, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbability = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbability, overtoppingRateCategoryName, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliability = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliability, overtoppingRateCategoryName, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculationConvergence = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculationConvergence, overtoppingRateCategoryName, "Convergentie", "Is convergentie bereikt in de overslagdebiet berekening?", true); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, illustrationPointsCategoryName, "Maatgevende windrichting", "De windrichting waarvoor de berekende betrouwbaarheidsindex het laagst is.", true); PropertyDescriptor alphaValuesProperty = dynamicProperties[alphaValuesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphaValuesProperty, illustrationPointsCategoryName, "Invloedscoëfficiënten [-]", "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", true); PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, illustrationPointsCategoryName, "Tijdsduren [uur]", "Tijdsduren waarop de stochasten betrekking hebben.", true); PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(illustrationPointProperty, illustrationPointsCategoryName, "Illustratiepunten", "De lijst van illustratiepunten voor de berekening.", true); }
public void Constructor_HasGeneralResult_PropertiesHaveExpectedAttributesValues() { // Setup var generalResult = new TestGeneralResultFaultTreeIllustrationPoint(); var structuresOutput = new StructuresOutput(0, generalResult); // Call var properties = new StructuresOutputProperties(structuresOutput); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, 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); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, illustrationPointsCategoryName, "Maatgevende windrichting", "De windrichting waarvoor de berekende betrouwbaarheidsindex het laagst is.", true); PropertyDescriptor alphaValuesProperty = dynamicProperties[alphaValuesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphaValuesProperty, illustrationPointsCategoryName, "Invloedscoëfficiënten [-]", "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", true); PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, illustrationPointsCategoryName, "Tijdsduren [uur]", "Tijdsduren waarop de stochasten betrekking hebben.", true); PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(illustrationPointProperty, illustrationPointsCategoryName, "Illustratiepunten", "De lijst van illustratiepunten voor de berekening.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup const double waterLevel = 3.09378; const double waveHeight = 4.29884; const double wavePeakPeriod = 0.19435; const double waveAngle = 180.62353; const double waveDirection = 230.5326; const double targetProbability = 0.5; const double targetReliability = 3000; const double calculatedProbability = 0.4; const double calculatedReliability = 6000; // Call var properties = new WaveConditionsOutputProperties { Data = new WaveConditionsOutput(waterLevel, waveHeight, wavePeakPeriod, waveAngle, waveDirection, targetProbability, targetReliability, calculatedProbability, calculatedReliability, CalculationConvergence.NotCalculated) }; // Assert TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); Assert.IsInstanceOf <ExpandableObjectConverter>(classTypeConverter); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(10, dynamicProperties.Count); PropertyDescriptor waterLevelProperty = dynamicProperties[requiredWaterLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waterLevelProperty, "Algemeen", "Waterstand [m+NAP]", "De waterstand waarvoor de golfhoogte, -periode en -richting zijn berekend.", true); PropertyDescriptor waveHeightProperty = dynamicProperties[requiredWaveHeightPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, "Algemeen", "Golfhoogte (Hs) [m]", "Berekende golfhoogte.", true); PropertyDescriptor wavePeakPeriodProperty = dynamicProperties[requiredWavePeakPeriodPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(wavePeakPeriodProperty, "Algemeen", "Golfperiode (Tp) [s]", "Berekende golfperiode.", true); PropertyDescriptor waveDirectionProperty = dynamicProperties[requiredWaveDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveDirectionProperty, "Algemeen", "Golfrichting t.o.v. Noord [°]", "Berekende maatgevende golfrichting ten opzichte van het noorden.", true); PropertyDescriptor waveAngleProperty = dynamicProperties[requiredWaveAnglePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveAngleProperty, "Algemeen", "Golfrichting t.o.v. dijknormaal [°]", "Berekende maatgevende golfrichting ten opzichte van de dijknormaal.", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[requiredTargetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, "Algemeen", "Doelkans [1/jaar]", "De opgegeven kans waarvoor het resultaat is berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[requiredTargetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, "Algemeen", "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de opgegeven kans waarvoor het resultaat is berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[requiredCalculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, "Algemeen", "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[requiredCalculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, "Algemeen", "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het resultaat.", true); PropertyDescriptor calculationConvergenceProperty = dynamicProperties[requiredConvergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculationConvergenceProperty, "Algemeen", "Convergentie", "Is convergentie bereikt voor de berekening?", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Call var properties = new SemiProbabilisticPipingOutputProperties(PipingTestDataGenerator.GetRandomSemiProbabilisticPipingOutput(), 0.1); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(16, dynamicProperties.Count); const string heaveCategory = "\t\tHeave"; const string upliftCategory = "\t\t\tOpbarsten"; const string sellmeijerCategory = "\tTerugschrijdende erosie (Sellmeijer)"; const string pipingCategory = "Piping"; PropertyDescriptor upliftEffectiveStress = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(upliftEffectiveStress, upliftCategory, "Gewicht van de deklaag [kN/m²]", "Het effectieve gewicht van de deklaag.", true); PropertyDescriptor upliftFactorOfSafetyProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(upliftFactorOfSafetyProperty, upliftCategory, "Veiligheidsfactor [-]", "De veiligheidsfactor voor het submechanisme opbarsten voor deze berekening.", true); PropertyDescriptor upliftReliabilityProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(upliftReliabilityProperty, upliftCategory, "Betrouwbaarheidsindex [-]", "De betrouwbaarheidsindex voor het submechanisme opbarsten voor deze berekening.", true); PropertyDescriptor upliftProbabilityProperty = dynamicProperties[3]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(upliftProbabilityProperty, upliftCategory, "Kans van voorkomen [1/jaar]", "De kans dat het submechanisme opbarsten optreedt voor deze berekening.", true); PropertyDescriptor heaveGradientProperty = dynamicProperties[4]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(heaveGradientProperty, heaveCategory, "Heave gradiënt [-]", "De optredende verticale gradiënt in het opbarstkanaal.", true); PropertyDescriptor heaveFactorOfSafetyProperty = dynamicProperties[5]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(heaveFactorOfSafetyProperty, heaveCategory, "Veiligheidsfactor [-]", "De veiligheidsfactor voor het submechanisme heave voor deze berekening.", true); PropertyDescriptor heaveReliabilityProperty = dynamicProperties[6]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(heaveReliabilityProperty, heaveCategory, "Betrouwbaarheidsindex [-]", "De betrouwbaarheidsindex voor het submechanisme heave voor deze berekening.", true); PropertyDescriptor heaveProbabilityProperty = dynamicProperties[7]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(heaveProbabilityProperty, heaveCategory, "Kans van voorkomen [1/jaar]", "De kans dat het submechanisme heave optreedt voor deze berekening.", true); PropertyDescriptor sellmeijerCreepCoefficientProperty = dynamicProperties[8]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sellmeijerCreepCoefficientProperty, sellmeijerCategory, "Creep coëfficiënt [-]", "De verhouding tussen de kwelweglengte en het berekende kritieke verval op basis van de regel van Sellmeijer (analoog aan de vuistregel van Bligh).", true); PropertyDescriptor sellmeijerCriticalFallProperty = dynamicProperties[9]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sellmeijerCriticalFallProperty, sellmeijerCategory, "Kritiek verval [m]", "Het kritieke verval over de waterkering.", true); PropertyDescriptor sellmeijerReducedFallProperty = dynamicProperties[10]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sellmeijerReducedFallProperty, sellmeijerCategory, "Gereduceerd verval [m]", "Het verschil tussen de buitenwaterstand en de binnenwaterstand, gecorrigeerd voor de drukval in het opbarstkanaal.", true); PropertyDescriptor sellmeijerFactorOfSafetyProperty = dynamicProperties[11]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sellmeijerFactorOfSafetyProperty, sellmeijerCategory, "Veiligheidsfactor [-]", "De veiligheidsfactor voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening.", true); PropertyDescriptor sellmeijerReliabilityProperty = dynamicProperties[12]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sellmeijerReliabilityProperty, sellmeijerCategory, "Betrouwbaarheidsindex [-]", "De betrouwbaarheidsindex voor het submechanisme terugschrijdende erosie (Sellmeijer) voor deze berekening.", true); PropertyDescriptor sellmeijerProbabilityProperty = dynamicProperties[13]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sellmeijerProbabilityProperty, sellmeijerCategory, "Kans van voorkomen [1/jaar]", "De kans dat het submechanisme terugschrijdende erosie (Sellmeijer) optreedt voor deze berekening.", true); PropertyDescriptor pipingProbabilityProperty = dynamicProperties[14]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(pipingProbabilityProperty, pipingCategory, "Benaderde faalkans [1/jaar]", "De benaderde kans dat het faalmechanisme piping optreedt voor deze berekening.", true); PropertyDescriptor pipingReliabilityProperty = dynamicProperties[15]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(pipingReliabilityProperty, pipingCategory, "Betrouwbaarheidsindex faalkans [-]", "De betrouwbaarheidsindex van de faalkans voor deze berekening.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup ClosingStructure structure = new TestClosingStructure(); // Call var properties = new ClosingStructureProperties { Data = structure }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(18, dynamicProperties.Count); const string schematizationCategory = "Schematisatie"; const string generalCategory = "Algemeen"; PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, generalCategory, "ID", "ID van het kunstwerk.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het kunstwerk.", true); PropertyDescriptor locationProperty = dynamicProperties[locationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationProperty, generalCategory, "Locatie (RD) [m]", "De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", true); PropertyDescriptor identicalAperturesProperty = dynamicProperties[identicalAperturesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(identicalAperturesProperty, schematizationCategory, "Aantal identieke doorstroomopeningen [-]", "Aantal identieke doorstroomopeningen.", true); PropertyDescriptor failureProbabilityOpenStructureProperty = dynamicProperties[failureProbabilityOpenStructurePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureProbabilityOpenStructureProperty, schematizationCategory, "Kans mislukken sluiting [-]", "Kans op mislukken sluiting van geopend kunstwerk.", true); PropertyDescriptor probabilityOpenStructureBeforeFloodingProperty = dynamicProperties[probabilityOpenStructureBeforeFloodingPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityOpenStructureBeforeFloodingProperty, schematizationCategory, "Kans op open staan bij naderend hoogwater [-]", "Kans op open staan bij naderend hoogwater.", true); PropertyDescriptor failureProbabilityReparationProperty = dynamicProperties[failureProbabilityReparationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureProbabilityReparationProperty, schematizationCategory, "Faalkans herstel van gefaalde situatie [-]", "Faalkans herstel van gefaalde situatie.", true); PropertyDescriptor inflowModelTypeProperty = dynamicProperties[inflowModelTypePropertyIndex]; Assert.IsInstanceOf <EnumConverter>(inflowModelTypeProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inflowModelTypeProperty, schematizationCategory, "Instroommodel", "Instroommodel van het kunstwerk.", true); PropertyDescriptor insideWaterLevelProperty = dynamicProperties[insideWaterLevelPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(insideWaterLevelProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(insideWaterLevelProperty, schematizationCategory, "Binnenwaterstand [m+NAP]", "Binnenwaterstand.", true); PropertyDescriptor structureNormalOrientationProperty = dynamicProperties[structureNormalOrientationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureNormalOrientationProperty, schematizationCategory, "Oriëntatie [°]", "Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden.", true); PropertyDescriptor areaFlowAperturesProperty = dynamicProperties[areaFlowAperturesPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(areaFlowAperturesProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(areaFlowAperturesProperty, schematizationCategory, "Doorstroomoppervlak [m²]", "Doorstroomoppervlak van doorstroomopeningen.", true); PropertyDescriptor thresholdHeightOpenWeirProperty = dynamicProperties[thresholdHeightOpenWeirPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(thresholdHeightOpenWeirProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(thresholdHeightOpenWeirProperty, schematizationCategory, "Drempelhoogte [m+NAP]", "Drempelhoogte niet gesloten kering of hoogte van de onderkant van de wand/drempel.", true); PropertyDescriptor levelCrestStructureNotClosingProperty = dynamicProperties[levelCrestStructureNotClosingPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(levelCrestStructureNotClosingProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(levelCrestStructureNotClosingProperty, schematizationCategory, "Kruinhoogte niet gesloten kering [m+NAP]", "Niveau kruin bij niet gesloten maximaal kerende keermiddelen.", true); PropertyDescriptor widthFlowAperturesProperty = dynamicProperties[widthFlowAperturesPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(widthFlowAperturesProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(widthFlowAperturesProperty, schematizationCategory, "Breedte van doorstroomopening [m]", "Breedte van de doorstroomopening.", true); PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[criticalOvertoppingDischargePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(criticalOvertoppingDischargeProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(criticalOvertoppingDischargeProperty, schematizationCategory, "Kritiek instromend debiet [m³/s/m]", "Kritiek instromend debiet directe invoer per strekkende meter.", true); PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[flowWidthAtBottomProtectionPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(flowWidthAtBottomProtectionProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(flowWidthAtBottomProtectionProperty, schematizationCategory, "Stroomvoerende breedte bodembescherming [m]", "Stroomvoerende breedte bodembescherming.", true); PropertyDescriptor storageStructureAreaProperty = dynamicProperties[storageStructureAreaPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(storageStructureAreaProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(storageStructureAreaProperty, schematizationCategory, "Kombergend oppervlak [m²]", "Kombergend oppervlak.", true); PropertyDescriptor allowedLevelIncreaseStorageProperty = dynamicProperties[allowedLevelIncreaseStoragePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(allowedLevelIncreaseStorageProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(allowedLevelIncreaseStorageProperty, schematizationCategory, "Toegestane peilverhoging komberging [m]", "Toegestane peilverhoging komberging.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var duneLocationCalculation = new DuneLocationCalculation(new TestDuneLocation()); // Call var properties = new DuneLocationCalculationProperties(duneLocationCalculation); // Assert TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(14, dynamicProperties.Count); Assert.IsInstanceOf <ExpandableObjectConverter>(classTypeConverter); PropertyDescriptor idProperty = dynamicProperties[requiredIdPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, "Algemeen", "ID", "ID van de hydraulische belastingenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[requiredNamePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, "Algemeen", "Naam", "Naam van de hydraulische belastingenlocatie.", true); PropertyDescriptor coastalAreaIdProperty = dynamicProperties[requiredCoastalAreaIdPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coastalAreaIdProperty, "Algemeen", "Kustvaknummer", "Nummer van het kustvak waar de locatie onderdeel van uitmaakt.", true); PropertyDescriptor offsetProperty = dynamicProperties[requiredOffSetPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(offsetProperty, "Algemeen", "Metrering [dam]", "Metrering van de locatie binnen het kustvak waar het onderdeel van uitmaakt.", true); PropertyDescriptor locationProperty = dynamicProperties[requiredLocationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationProperty, "Algemeen", "Coördinaten [m]", "Coördinaten van de hydraulische belastingenlocatie.", true); PropertyDescriptor waterLevelProperty = dynamicProperties[requiredWaterLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waterLevelProperty, "Resultaat", "Rekenwaarde waterstand [m+NAP]", "Berekende rekenwaarde voor de waterstand voor het uitvoeren van een sterkteberekening voor het faalmechanisme duinen.", true); PropertyDescriptor waveHeightProperty = dynamicProperties[requiredWaveHeightPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, "Resultaat", "Rekenwaarde Hs [m]", "Berekende rekenwaarde voor de significante golfhoogte voor het uitvoeren van een sterkteberekening voor het faalmechanisme duinen.", true); PropertyDescriptor wavePeriodProperty = dynamicProperties[requiredWavePeriodPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(wavePeriodProperty, "Resultaat", "Rekenwaarde Tp [s]", "Berekende rekenwaarde voor de piekperiode van de golven voor het uitvoeren van een sterkteberekening voor het faalmechanisme duinen.", true); PropertyDescriptor d50Property = dynamicProperties[requiredD50PropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(d50Property, "Resultaat", "Rekenwaarde d50 [m]", "Rekenwaarde voor de d50 voor het uitvoeren van een sterkteberekening voor het faalmechanisme duinen.", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[requiredTargetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, "Resultaat", "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[requiredTargetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, "Resultaat", "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[requiredCalculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, "Resultaat", "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[requiredCalculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, "Resultaat", "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[requiredConvergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, "Resultaat", "Convergentie", "Is convergentie bereikt in de berekening van de hydraulische belastingen voor de duinlocatie?", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues(bool isStyleEditable) { // Setup var chartPointData = new ChartPointData("Test", new ChartPointStyle { IsEditable = isStyleEditable }); // Call var properties = new ChartPointDataProperties { Data = chartPointData }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(8, dynamicProperties.Count); const string styleCategory = "Stijl"; PropertyDescriptor colorProperty = dynamicProperties[colorPropertyIndex]; Assert.IsInstanceOf <ColorTypeConverter>(colorProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(colorProperty, styleCategory, "Kleur", "De kleur van de symbolen 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 symbolen waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); PropertyDescriptor strokeThicknessProperty = dynamicProperties[strokeThicknessPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(strokeThicknessProperty, styleCategory, "Lijndikte", "De dikte van de lijn van de symbolen waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); PropertyDescriptor sizeProperty = dynamicProperties[sizePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(sizeProperty, styleCategory, "Grootte", "De grootte van de symbolen waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); PropertyDescriptor symbolProperty = dynamicProperties[symbolPropertyIndex]; Assert.IsInstanceOf <EnumTypeConverter>(symbolProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(symbolProperty, styleCategory, "Symbool", "Het symbool waarmee deze gegevensreeks wordt weergegeven.", !isStyleEditable); }
public void Constructor_WithData_PropertiesHaveExpectedAttributesValues() { // Setup var handler = mockRepository.Stub <IObservablePropertyChangeHandler>(); mockRepository.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); var calculation = new StructuresCalculation <HeightStructuresInput>(); var inputContext = new HeightStructuresInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection); // Call var properties = new HeightStructuresInputContextProperties(inputContext, handler); // Assert const string generalCategory = "\t\t\t\t\t\tAlgemeen"; const string modelSettingsCategory = "\t\t\t\t\tModelinstellingen"; const string schematizationIncomingFlowCategory = "\t\t\t\tSchematisering instromend debiet/volume"; const string schematizationGroundErosionCategory = "\t\t\tSchematisering bodembescherming"; const string schematizationStorageStructureCategory = "\t\tSchematisering komberging"; const string foreshoreCategory = "\tVoorland en (haven)dam"; const string outputSettingsCategory = "Uitvoer"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(17, dynamicProperties.Count); PropertyDescriptor structureProperty = dynamicProperties[structurePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureProperty, generalCategory, "Kunstwerk", "Het kunstwerk dat gebruikt wordt in de berekening."); PropertyDescriptor structureLocationProperty = dynamicProperties[structureLocationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureLocationProperty, generalCategory, "Locatie (RD) [m]", "De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", true); PropertyDescriptor hydraulicBoundaryLocationProperty = dynamicProperties[hydraulicBoundaryLocationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(hydraulicBoundaryLocationProperty, generalCategory, "Hydraulische belastingenlocatie", "De hydraulische belastingenlocatie."); PropertyDescriptor modelFactorSuperCriticalFlowProperty = dynamicProperties[modelFactorSuperCriticalFlowPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(modelFactorSuperCriticalFlowProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(modelFactorSuperCriticalFlowProperty, modelSettingsCategory, "Modelfactor overloopdebiet volkomen overlaat [-]", "Modelfactor voor het overloopdebiet over een volkomen overlaat.", true); PropertyDescriptor structureNormalOrientationProperty = dynamicProperties[structureNormalOrientationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureNormalOrientationProperty, schematizationIncomingFlowCategory, "Oriëntatie [°]", "Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden.", true); PropertyDescriptor levelCrestStructureProperty = dynamicProperties[levelCrestStructurePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(levelCrestStructureProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(levelCrestStructureProperty, schematizationIncomingFlowCategory, "Kerende hoogte [m+NAP]", "Kerende hoogte van het kunstwerk.", true); PropertyDescriptor widthFlowAperturesProperty = dynamicProperties[widthFlowAperturesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(widthFlowAperturesProperty, schematizationIncomingFlowCategory, "Breedte van doorstroomopening [m]", "Breedte van de doorstroomopening.", true); PropertyDescriptor stormDurationProperty = dynamicProperties[stormDurationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(stormDurationProperty, schematizationIncomingFlowCategory, "Stormduur [uur]", "Stormduur.", true); PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[criticalOvertoppingDischargePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(criticalOvertoppingDischargeProperty, schematizationGroundErosionCategory, "Kritiek instromend debiet [m³/s/m]", "Kritiek instromend debiet directe invoer per strekkende meter.", true); PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[flowWidthAtBottomProtectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(flowWidthAtBottomProtectionProperty, schematizationGroundErosionCategory, "Stroomvoerende breedte bodembescherming [m]", "Stroomvoerende breedte bodembescherming.", true); PropertyDescriptor failureProbabilityStructureWithErosionProperty = dynamicProperties[failureProbabilityStructureWithErosionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureProbabilityStructureWithErosionProperty, schematizationGroundErosionCategory, "Faalkans gegeven erosie bodem [-]", "Faalkans kunstwerk gegeven erosie bodem.", true); PropertyDescriptor storageStructureAreaProperty = dynamicProperties[storageStructureAreaPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(storageStructureAreaProperty, schematizationStorageStructureCategory, "Kombergend oppervlak [m²]", "Kombergend oppervlak.", true); PropertyDescriptor allowedLevelIncreaseStorageProperty = dynamicProperties[allowedLevelIncreaseStoragePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(allowedLevelIncreaseStorageProperty, schematizationStorageStructureCategory, "Toegestane peilverhoging komberging [m]", "Toegestane peilverhoging komberging.", true); PropertyDescriptor foreshoreProfileProperty = dynamicProperties[foreshoreProfilePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(foreshoreProfileProperty, foreshoreCategory, "Voorlandprofiel", "De schematisatie van het voorlandprofiel."); PropertyDescriptor useBreakWaterProperty = dynamicProperties[useBreakWaterPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(useBreakWaterProperty, foreshoreCategory, "Dam", "Eigenschappen van de dam.", true); PropertyDescriptor useForeshoreProperty = dynamicProperties[useForeshorePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(useForeshoreProperty, foreshoreCategory, "Voorlandgeometrie", "Eigenschappen van de voorlandgeometrie.", true); PropertyDescriptor shouldIllustrationPointsBeCalculatedProperty = dynamicProperties[calculateIllustrationPointsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(shouldIllustrationPointsBeCalculatedProperty, outputSettingsCategory, "Illustratiepunten inlezen", "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); mockRepository.VerifyAll(); }
public void Constructor_CanUsePreprocessorTrue_PropertiesHaveExpectedAttributesValues(bool usePreprocessor) { // Setup var mocks = new MockRepository(); var importHandler = mocks.Stub <IHydraulicLocationConfigurationDatabaseImportHandler>(); mocks.ReplayAll(); var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { HydraulicLocationConfigurationSettings = { CanUsePreprocessor = true, UsePreprocessor = usePreprocessor, PreprocessorDirectory = "Preprocessor" } }; // Call var properties = new HydraulicBoundaryDatabaseProperties(hydraulicBoundaryDatabase, importHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(14, dynamicProperties.Count); const string expectedCategory = "Algemeen"; PropertyDescriptor hrdFilePathProperty = dynamicProperties[hrdFilePathPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(hrdFilePathProperty, expectedCategory, "HRD bestandslocatie", "Locatie van het HRD bestand.", true); PropertyDescriptor hlcdFilePathProperty = dynamicProperties[hlcdFilePathPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(hlcdFilePathProperty, expectedCategory, "HLCD bestandslocatie", "Locatie van het HLCD bestand.", true); PropertyDescriptor usePreprocessorClosureProperty = dynamicProperties[usePreprocessorClosurePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(usePreprocessorClosureProperty, expectedCategory, "Gebruik preprocessor sluitregime database", "Gebruik de preprocessor sluitregime database bij het uitvoeren van een berekening.", true); PropertyDescriptor scenarioNameProperty = dynamicProperties[scenarioNamePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(scenarioNameProperty, expectedCategory, "Klimaatscenario", "Algemene naam van het klimaatscenario.", true); PropertyDescriptor yearProperty = dynamicProperties[yearPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(yearProperty, expectedCategory, "Zichtjaar", "Jaartal van het jaar waarop de statistiek van toepassing is.", true); PropertyDescriptor scopeProperty = dynamicProperties[scopePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(scopeProperty, expectedCategory, "Toepassingskader", "Projectkader waarin de statistiek bedoeld is te gebruiken.", true); PropertyDescriptor seaLevelProperty = dynamicProperties[seaLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(seaLevelProperty, expectedCategory, "Zeewaterstand", "Klimaatinformatie met betrekking tot de zeewaterstand.", true); PropertyDescriptor riverDischargeProperty = dynamicProperties[riverDischargePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(riverDischargeProperty, expectedCategory, "Rivierafvoer", "Klimaatinformatie met betrekking tot de rivierafvoer.", true); PropertyDescriptor lakeLevelProperty = dynamicProperties[lakeLevelPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lakeLevelProperty, expectedCategory, "Meerpeil", "Klimaatinformatie met betrekking tot het meerpeil/de meerpeilen.", true); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, expectedCategory, "Windrichting", "Klimaatinformatie met betrekking tot de windrichting.", true); PropertyDescriptor windSpeedProperty = dynamicProperties[windSpeedPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windSpeedProperty, expectedCategory, "Windsnelheid", "Klimaatinformatie met betrekking tot de windsnelheid.", true); PropertyDescriptor commentProperty = dynamicProperties[commentPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(commentProperty, expectedCategory, "Overig", "Overige informatie.", true); PropertyDescriptor usePreprocessorProperty = dynamicProperties[usePreprocessorPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(usePreprocessorProperty, expectedCategory, "Gebruik preprocessor", "Gebruik de preprocessor bij het uitvoeren van een berekening."); PropertyDescriptor preprocessorDirectoryProperty = dynamicProperties[preprocessorDirectoryPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(preprocessorDirectoryProperty, expectedCategory, "Locatie preprocessor bestanden", "Locatie waar de preprocessor bestanden opslaat.", !usePreprocessor); mocks.VerifyAll(); }
public void Constructor_WithGeneralIllustrationPointsResult_PropertiesHaveExpectedAttributesValues() { // Setup var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) { Output = new TestHydraulicBoundaryLocationCalculationOutput(new TestGeneralResultSubMechanismIllustrationPoint()) }; // Call var properties = new TestHydraulicBoundaryLocationCalculationProperties(hydraulicBoundaryLocationCalculation); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(14, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string resultCategory = "Resultaat"; const string illustrationPointsCategory = "Illustratiepunten"; PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, generalCategory, "ID", "ID van de hydraulische belastingenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "Naam van de hydraulische belastingenlocatie.", true); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, generalCategory, "Coördinaten [m]", "Coördinaten van de hydraulische belastingenlocatie.", true); PropertyDescriptor resultProperty = dynamicProperties[resultPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(resultProperty, resultCategory, nameof(properties.Result), "", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, resultCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, resultCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, resultCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, resultCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, resultCategory, "Convergentie", string.Empty, true); PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, illustrationPointsCategory, "Illustratiepunten inlezen", "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dynamicProperties[governingWindDirectionIndex], illustrationPointsCategory, "Maatgevende windrichting", "De windrichting waarvoor de berekende betrouwbaarheidsindex het laagst is.", true); PropertyDescriptor alphaValuesProperty = dynamicProperties[alphaValuesIndex]; Assert.NotNull(alphaValuesProperty.Attributes[typeof(KeyValueElementAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphaValuesProperty, illustrationPointsCategory, "Invloedscoëfficiënten [-]", "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", true); PropertyDescriptor durationsProperty = dynamicProperties[durationsIndex]; Assert.NotNull(durationsProperty.Attributes[typeof(KeyValueElementAttribute)]); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, illustrationPointsCategory, "Tijdsduren [uur]", "Tijdsduren waarop de stochasten betrekking hebben.", true); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dynamicProperties[illustrationPointsIndex], illustrationPointsCategory, "Illustratiepunten", "De lijst van illustratiepunten voor de berekening.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var probabilityAssessmentInput = new TestProbabilityAssessmentInput(0.5, 100); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); // Call var properties = new FailureMechanismSectionProbabilityAssessmentProperties(section, double.NaN, double.NaN, probabilityAssessmentInput); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(7, 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); PropertyDescriptor nProperty = dynamicProperties[6]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nProperty, "Algemeen", "Nvak* [-]", "Vakspecifieke waarde voor het in rekening brengen van " + "het lengte-effect tijdens assemblage (afgerond).", true); }
public void Constructor_WithoutGeneralIllustrationPointsResult_PropertiesHaveExpectedAttributesValues() { // Setup var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); // Call var properties = new TestHydraulicBoundaryLocationCalculationProperties(hydraulicBoundaryLocationCalculation); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(10, dynamicProperties.Count); const string generalCategory = "Algemeen"; const string resultCategory = "Resultaat"; const string illustrationPointsCategory = "Illustratiepunten"; PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, generalCategory, "ID", "ID van de hydraulische belastingenlocatie in de database.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "Naam van de hydraulische belastingenlocatie.", true); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, generalCategory, "Coördinaten [m]", "Coördinaten van de hydraulische belastingenlocatie.", true); PropertyDescriptor resultProperty = dynamicProperties[resultPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(resultProperty, resultCategory, nameof(properties.Result), "", true); PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, resultCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, resultCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, resultCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, resultCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, resultCategory, "Convergentie", string.Empty, true); PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, illustrationPointsCategory, "Illustratiepunten inlezen", "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); }
public void Constructor_InAssemblyTrue_PropertiesHaveExpectedAttributeValues() { // Call var properties = new ClosingStructuresFailureMechanismProperties(new ClosingStructuresFailureMechanism()); // Assert const string generalCategory = "Algemeen"; const string lengthEffectCategory = "Lengte-effect"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(7, 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 inAssemblyProperty = dynamicProperties[inAssemblyPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(inAssemblyProperty, generalCategory, "In assemblage", "Geeft aan of dit faalmechanisme wordt meegenomen in de assemblage.", true); PropertyDescriptor cProperty = dynamicProperties[cPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(cProperty, lengthEffectCategory, "C [-]", "De parameter 'C' die gebruikt wordt om het lengte-effect te berekenen.", true); PropertyDescriptor n2AProperty = dynamicProperties[n2APropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(n2AProperty, lengthEffectCategory, "2NA [-]", "De parameter '2NA' die gebruikt wordt om het lengte-effect te berekenen."); 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 (afgerond).", true); 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); }
public void Constructor_HasGeneralResult_PropertiesHaveExpectedAttributesValues() { // Setup PartialProbabilisticSubMechanismPipingOutput output = PipingTestDataGenerator.GetRandomPartialProbabilisticSubMechanismPipingOutput(); // Call var properties = new ProbabilisticSubMechanismPipingOutputProperties(output); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, 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); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, illustrationPointsCategoryName, "Maatgevende windrichting", "De windrichting waarvoor de berekende betrouwbaarheidsindex het laagst is.", true); PropertyDescriptor alphaValuesProperty = dynamicProperties[alphaValuesPropertyIndex]; TestHelper.AssertTypeConverter <ProbabilisticSubMechanismPipingOutputProperties, KeyValueExpandableArrayConverter>( nameof(ProbabilisticSubMechanismPipingOutputProperties.AlphaValues)); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphaValuesProperty, illustrationPointsCategoryName, "Invloedscoëfficiënten [-]", "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", true); PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; TestHelper.AssertTypeConverter <ProbabilisticSubMechanismPipingOutputProperties, KeyValueExpandableArrayConverter>( nameof(ProbabilisticSubMechanismPipingOutputProperties.Durations)); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, illustrationPointsCategoryName, "Tijdsduren [uur]", "Tijdsduren waarop de stochasten betrekking hebben.", true); PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointsPropertyIndex]; TestHelper.AssertTypeConverter <ProbabilisticSubMechanismPipingOutputProperties, ExpandableArrayConverter>( nameof(ProbabilisticSubMechanismPipingOutputProperties.IllustrationPoints)); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(illustrationPointProperty, illustrationPointsCategoryName, "Illustratiepunten", "De lijst van illustratiepunten voor de berekening.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var structure = new TestHeightStructure(); // Call var properties = new HeightStructureProperties { Data = structure }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(11, dynamicProperties.Count); const string schematizationCategory = "Schematisatie"; const string generalCategory = "Algemeen"; PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, generalCategory, "ID", "ID van het kunstwerk.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, generalCategory, "Naam", "De naam van het kunstwerk.", true); PropertyDescriptor locationProperty = dynamicProperties[locationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationProperty, generalCategory, "Locatie (RD) [m]", "De coördinaten van de locatie van het kunstwerk in het Rijksdriehoeksstelsel.", true); PropertyDescriptor structureNormalOrientationProperty = dynamicProperties[structureNormalOrientationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(structureNormalOrientationProperty, schematizationCategory, "Oriëntatie [°]", "Oriëntatie van de normaal van het kunstwerk ten opzichte van het noorden.", true); PropertyDescriptor levelCrestStructureProperty = dynamicProperties[levelCrestStructurePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(levelCrestStructureProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(levelCrestStructureProperty, schematizationCategory, "Kerende hoogte [m+NAP]", "Kerende hoogte van het kunstwerk.", true); PropertyDescriptor widthFlowAperturesProperty = dynamicProperties[widthFlowAperturesPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(widthFlowAperturesProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(widthFlowAperturesProperty, schematizationCategory, "Breedte van doorstroomopening [m]", "Breedte van de doorstroomopening.", true); PropertyDescriptor criticalOvertoppingDischargeProperty = dynamicProperties[criticalOvertoppingDischargePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(criticalOvertoppingDischargeProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(criticalOvertoppingDischargeProperty, schematizationCategory, "Kritiek instromend debiet [m³/s/m]", "Kritiek instromend debiet directe invoer per strekkende meter.", true); PropertyDescriptor flowWidthAtBottomProtectionProperty = dynamicProperties[flowWidthAtBottomProtectionPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(flowWidthAtBottomProtectionProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(flowWidthAtBottomProtectionProperty, schematizationCategory, "Stroomvoerende breedte bodembescherming [m]", "Stroomvoerende breedte bodembescherming.", true); PropertyDescriptor failureProbabilityStructureWithErosionProperty = dynamicProperties[failureProbabilityStructureWithErosionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(failureProbabilityStructureWithErosionProperty, schematizationCategory, "Faalkans gegeven erosie bodem [-]", "Faalkans kunstwerk gegeven erosie bodem.", true); PropertyDescriptor storageStructureAreaProperty = dynamicProperties[storageStructureAreaPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(storageStructureAreaProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(storageStructureAreaProperty, schematizationCategory, "Kombergend oppervlak [m²]", "Kombergend oppervlak.", true); PropertyDescriptor allowedLevelIncreaseStorageProperty = dynamicProperties[allowedLevelIncreaseStoragePropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(allowedLevelIncreaseStorageProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(allowedLevelIncreaseStorageProperty, schematizationCategory, "Toegestane peilverhoging komberging [m]", "Toegestane peilverhoging komberging.", true); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var foreshoreProfile = new TestForeshoreProfile(); // Call var properties = new ForeshoreProfileProperties { Data = foreshoreProfile }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, "Algemeen", "ID", "ID van het voorlandprofiel.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, "Algemeen", "Naam", "Naam van het voorlandprofiel.", true); PropertyDescriptor worldReferencePointProperty = dynamicProperties[worldReferencePointPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(worldReferencePointProperty, "Schematisatie", "Locatie (RD) [m]", "De coördinaten van de locatie van het voorlandprofiel in het Rijksdriehoeksstelsel.", true); PropertyDescriptor orientationProperty = dynamicProperties[orientationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(orientationProperty, "Schematisatie", "Oriëntatie [°]", "Oriëntatie van de dijknormaal ten opzichte van het noorden.", true); PropertyDescriptor breakWaterProperty = dynamicProperties[breakWaterPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(breakWaterProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(breakWaterProperty, "Schematisatie", "Dam", "Eigenschappen van de dam.", true); PropertyDescriptor foreshoreProperty = dynamicProperties[foreshoreGeometryPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(foreshoreProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(foreshoreProperty, "Schematisatie", "Voorlandgeometrie", "Eigenschappen van de voorlandgeometrie.", true); }
public void Constructor_ExpectedValues() { // Setup var stochast = new Stochast("Stochast A", 10.0, 2.5); var illustrationPoint = new FaultTreeIllustrationPoint("Fault tree Test", 1.5, new[] { stochast }, CombinationType.And); var illustrationPointNodeChild1 = new IllustrationPointNode(new FaultTreeIllustrationPoint("Fault tree child", 3.5, new[] { stochast }, CombinationType.Or)); var illustrationPointNodeChild2 = new IllustrationPointNode(new FaultTreeIllustrationPoint("Fault tree child 2", 3.5, new Stochast[0], CombinationType.Or)); IllustrationPointNode[] illustrationPointNodeChildren = { illustrationPointNodeChild1, illustrationPointNodeChild2 }; // Call var properties = new FaultTreeIllustrationPointProperties(illustrationPoint, illustrationPointNodeChildren, "NNE", "closing situation"); // 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("NNE", properties.WindDirection); Assert.AreEqual(illustrationPoint.Beta, properties.Reliability, properties.Reliability.GetAccuracy()); Assert.AreEqual(5, properties.Reliability.NumberOfDecimalPlaces); Assert.AreEqual(StatisticsConverter.ReliabilityToProbability(illustrationPoint.Beta), properties.CalculatedProbability); Assert.AreEqual("closing situation", properties.ClosingSituation); TestHelper.AssertTypeConverter <FaultTreeIllustrationPointProperties, KeyValueExpandableArrayConverter>( nameof(FaultTreeIllustrationPointProperties.AlphaValues)); CollectionAssert.IsNotEmpty(properties.AlphaValues); CollectionAssert.AreEqual(new[] { stochast }, properties.AlphaValues); TestHelper.AssertTypeConverter <FaultTreeIllustrationPointProperties, KeyValueExpandableArrayConverter>( nameof(FaultTreeIllustrationPointProperties.Durations)); CollectionAssert.AreEqual(new[] { stochast }, properties.Durations); TestHelper.AssertTypeConverter <FaultTreeIllustrationPointProperties, ExpandableArrayConverter>( nameof(FaultTreeIllustrationPointProperties.IllustrationPoints)); Assert.AreEqual(2, properties.IllustrationPoints.Length); Assert.AreSame(illustrationPointNodeChild1.Data, properties.IllustrationPoints.ElementAt(0).Data); Assert.AreSame(illustrationPointNodeChild2.Data, properties.IllustrationPoints.ElementAt(1).Data); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributesValues(bool useDefaultOffsets) { // Setup var mocks = new MockRepository(); var changeHandler = mocks.Stub <IObservablePropertyChangeHandler>(); mocks.ReplayAll(); var input = new TestMacroStabilityInwardsLocationInput { UseDefaultOffsets = useDefaultOffsets }; // Call var properties = new MacroStabilityInwardsLocationInputOffsetProperties(input, changeHandler); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(5, dynamicProperties.Count); const string offsetCategory = "Offsets PL 1"; PropertyDescriptor useDefaultOffsetsProperty = dynamicProperties[expectedUseDefaultOffsetsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( useDefaultOffsetsProperty, offsetCategory, "Gebruik default waarden voor offsets van PL 1", "Gebruik standaard waterstandsverschillen voor het bepalen van de freatische lijn?"); PropertyDescriptor phreaticLineOffsetBelowDikeTopAtRiverProperty = dynamicProperties[expectedPhreaticLineOffsetBelowDikeTopAtRiverPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( phreaticLineOffsetBelowDikeTopAtRiverProperty, offsetCategory, "PL 1 offset onder buitenkruin [m]", "Verschil tussen de waterstand en de freatische lijn onder kruin buitentalud.", useDefaultOffsets); PropertyDescriptor phreaticLineOffsetBelowDikeTopAtPolderProperty = dynamicProperties[expectedPhreaticLineOffsetBelowDikeTopAtPolderPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( phreaticLineOffsetBelowDikeTopAtPolderProperty, offsetCategory, "PL 1 offset onder binnenkruin [m]", "Verschil tussen de waterstand en de freatische lijn onder kruin binnentalud.", useDefaultOffsets); PropertyDescriptor phreaticLineOffsetBelowShoulderBaseInsideProperty = dynamicProperties[expectedPhreaticLineOffsetBelowShoulderBaseInsidePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( phreaticLineOffsetBelowShoulderBaseInsideProperty, offsetCategory, "PL 1 offset onder insteek binnenberm [m]", "Waterstandsverschil tussen het maaiveld en de freatische lijn onder insteek binnenberm.", useDefaultOffsets); PropertyDescriptor phreaticLineOffsetBelowDikeToeAtPolderProperty = dynamicProperties[expectedPhreaticLineOffsetBelowDikeToeAtPolderPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties( phreaticLineOffsetBelowDikeToeAtPolderProperty, offsetCategory, "PL 1 offset onder teen dijk binnenwaarts [m]", "Waterstandsverschil tussen het maaiveld en de freatische lijn onder teen dijk binnenwaarts.", useDefaultOffsets); mocks.VerifyAll(); }
public void Constructor_NoUniqueClosingSituations_PropertiesHaveExpectedAttributesValues() { // Setup var topLevel = new TopLevelFaultTreeIllustrationPoint( new WindDirection("N", 5.0), "closing situation", new IllustrationPointNode(new TestFaultTreeIllustrationPoint())); // Call var properties = new TopLevelFaultTreeIllustrationPointProperties(topLevel, false); // Assert const string illustrationPointsCategoryName = "Illustratiepunten"; PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(7, dynamicProperties.Count); PropertyDescriptor probabilityProperty = dynamicProperties[probabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(probabilityProperty, illustrationPointsCategoryName, "Berekende kans [-]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor reliabilityProperty = dynamicProperties[reliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(reliabilityProperty, illustrationPointsCategoryName, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor windDirectionProperty = dynamicProperties[windDirectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(windDirectionProperty, illustrationPointsCategoryName, "Windrichting", "De windrichting waarvoor dit illlustratiepunt is berekend.", true); PropertyDescriptor closingSituationProperty = dynamicProperties[closingSituationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(closingSituationProperty, illustrationPointsCategoryName, "Keringsituatie", "De keringsituatie waarvoor dit illustratiepunt is berekend.", true); PropertyDescriptor alphasProperty = dynamicProperties[alphasPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphasProperty, illustrationPointsCategoryName, "Invloedscoëfficiënten [-]", "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", true); PropertyDescriptor durationsProperty = dynamicProperties[durationsPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, illustrationPointsCategoryName, "Tijdsduren [uur]", "Tijdsduren waarop de stochasten betrekking hebben.", true); PropertyDescriptor illustrationPointProperty = dynamicProperties[illustrationPointPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(illustrationPointProperty, illustrationPointsCategoryName, "Illustratiepunten", "De lijst van illustratiepunten voor de berekening.", true); }
public void PropertyAttributes_NoGeneralResult_ReturnExpectedValues() { // Setup var dikeHeightOutput = new TestDikeHeightOutput(10); // Call var properties = new DikeHeightOutputProperties(dikeHeightOutput); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); PropertyDescriptor dikeHeightProperty = dynamicProperties[dikeHeightPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dikeHeightProperty, dikeHeightCategory, "HBN [m+NAP]", "Het berekende Hydraulisch Belasting Niveau (HBN).", true); PropertyDescriptor targetProbability = dynamicProperties[targetProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbability, dikeHeightCategory, "Doelkans [1/jaar]", "De ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor targetReliability = dynamicProperties[targetReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliability, dikeHeightCategory, "Betrouwbaarheidsindex doelkans [-]", "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", true); PropertyDescriptor calculatedProbability = dynamicProperties[calculatedProbabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbability, dikeHeightCategory, "Berekende kans [1/jaar]", "De berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculatedReliability = dynamicProperties[calculatedReliabilityPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliability, dikeHeightCategory, "Betrouwbaarheidsindex berekende kans [-]", "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", true); PropertyDescriptor calculationConvergence = dynamicProperties[convergencePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculationConvergence, dikeHeightCategory, "Convergentie", "Is convergentie bereikt in de HBN berekening?", true); }