Example #1
0
        public void GetIllustrationPointControlItems_ViewWithData_ReturnsExpectedControlItems()
        {
            // Setup
            var topLevelIllustrationPoints = new[]
            {
                new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(),
                                                          "Regular",
                                                          new TestSubMechanismIllustrationPoint())
            };

            var generalResult = new TestGeneralResultSubMechanismIllustrationPoint(topLevelIllustrationPoints);
            var output        = new TestHydraulicBoundaryLocationCalculationOutput(generalResult);

            var calculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation())
            {
                Output = output
            };
            var calculations = new ObservableList <HydraulicBoundaryLocationCalculation>
            {
                calculation
            };

            TestHydraulicBoundaryCalculationsView view = ShowTestHydraulicBoundaryCalculationsView(calculations);

            // Call
            IEnumerable <IllustrationPointControlItem> actualControlItems =
                view.PublicGetIllustrationPointControlItems();

            // Assert
            IEnumerable <IllustrationPointControlItem> expectedControlItems =
                CreateControlItems(generalResult);

            CollectionAssert.AreEqual(expectedControlItems, actualControlItems,
                                      new IllustrationPointControlItemComparer());
        }
Example #2
0
        public void Constructor_ExpectedValues()
        {
            // Setup & Call
            TestHydraulicBoundaryCalculationsView view = ShowFullyConfiguredTestHydraulicBoundaryCalculationsView();

            // Assert
            Assert.IsInstanceOf <LocationCalculationsView <HydraulicBoundaryLocationCalculation> >(view);
            Assert.IsNull(view.Data);
        }
Example #3
0
        private TestHydraulicBoundaryCalculationsView ShowTestHydraulicBoundaryCalculationsView(IObservableEnumerable <HydraulicBoundaryLocationCalculation> calculations)
        {
            var view = new TestHydraulicBoundaryCalculationsView(calculations, new AssessmentSectionStub());

            testForm.Controls.Add(view);
            testForm.Show();

            return(view);
        }