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()); }
public void Constructor_ExpectedValues() { // Setup & Call TestHydraulicBoundaryCalculationsView view = ShowFullyConfiguredTestHydraulicBoundaryCalculationsView(); // Assert Assert.IsInstanceOf <LocationCalculationsView <HydraulicBoundaryLocationCalculation> >(view); Assert.IsNull(view.Data); }
private TestHydraulicBoundaryCalculationsView ShowTestHydraulicBoundaryCalculationsView(IObservableEnumerable <HydraulicBoundaryLocationCalculation> calculations) { var view = new TestHydraulicBoundaryCalculationsView(calculations, new AssessmentSectionStub()); testForm.Controls.Add(view); testForm.Show(); return(view); }