Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new instance of the <see cref="ClosingStructuresInputContextProperties"/> class.
 /// </summary>
 /// <param name="data">The instance to show the properties of.</param>
 /// <param name="propertyChangeHandler">The handler responsible for handling effects of a property change.</param>
 /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
 public ClosingStructuresInputContextProperties(ClosingStructuresInputContext data, IObservablePropertyChangeHandler propertyChangeHandler) :
     base(data, new ConstructionProperties
 {
     StructurePropertyIndex                              = structurePropertyIndex,
     StructureLocationPropertyIndex                      = structureLocationPropertyIndex,
     StructureNormalOrientationPropertyIndex             = structureNormalOrientationPropertyIndex,
     FlowWidthAtBottomProtectionPropertyIndex            = flowWidthAtBottomProtectionPropertyIndex,
     WidthFlowAperturesPropertyIndex                     = widthFlowAperturesPropertyIndex,
     StorageStructureAreaPropertyIndex                   = storageStructureAreaPropertyIndex,
     AllowedLevelIncreaseStoragePropertyIndex            = allowedLevelIncreaseStoragePropertyIndex,
     CriticalOvertoppingDischargePropertyIndex           = criticalOvertoppingDischargePropertyIndex,
     FailureProbabilityStructureWithErosionPropertyIndex = failureProbabilityStructureWithErosionPropertyIndex,
     ForeshoreProfilePropertyIndex                       = foreshoreProfilePropertyIndex,
     UseBreakWaterPropertyIndex                          = useBreakWaterPropertyIndex,
     UseForeshorePropertyIndex                           = useForeshorePropertyIndex,
     HydraulicBoundaryLocationPropertyIndex              = hydraulicBoundaryLocationPropertyIndex,
     StormDurationPropertyIndex                          = stormDurationPropertyIndex
 }, propertyChangeHandler)
 {
 }
Ejemplo n.º 2
0
        public void CreateInstance_WithContext_NewPropertiesWithFailureMechanismContextAsData()
        {
            // Setup
            var mocks             = new MockRepository();
            var assessmentSection = mocks.Stub <IAssessmentSection>();

            mocks.ReplayAll();

            var calculation      = new TestClosingStructuresCalculationScenario();
            var failureMechanism = new ClosingStructuresFailureMechanism();
            var context          = new ClosingStructuresInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection);

            // Call
            IObjectProperties objectProperties = info.CreateInstance(context);

            // Assert
            Assert.IsInstanceOf <ClosingStructuresInputContextProperties>(objectProperties);
            Assert.AreSame(context, objectProperties.Data);

            mocks.VerifyAll();
        }
Ejemplo n.º 3
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var mocks             = new MockRepository();
            var assessmentSection = mocks.Stub <IAssessmentSection>();

            mocks.ReplayAll();

            var calculation      = new StructuresCalculation <ClosingStructuresInput>();
            var failureMechanism = new ClosingStructuresFailureMechanism();

            // Call
            var context = new ClosingStructuresInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection);

            // Assert
            Assert.IsInstanceOf <InputContextBase <ClosingStructuresInput, StructuresCalculation <ClosingStructuresInput>, ClosingStructuresFailureMechanism> >(context);
            Assert.AreSame(calculation.InputParameters, context.WrappedData);
            Assert.AreSame(calculation, context.Calculation);
            Assert.AreSame(failureMechanism, context.FailureMechanism);
            Assert.AreSame(assessmentSection, context.AssessmentSection);
            mocks.VerifyAll();
        }