public void CreateCalculationFeatures_GivenCalculations_ReturnsCalculationFeaturesCollection() { // Setup var calculationA = new GrassCoverErosionOutwardsWaveConditionsCalculation(); var calculationB = new GrassCoverErosionOutwardsWaveConditionsCalculation(); calculationA.InputParameters.ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.0, 3.0)); calculationB.InputParameters.ForeshoreProfile = new TestForeshoreProfile(new Point2D(1.0, 4.0)); calculationA.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 5.0, 4.0); calculationB.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 2.2, 3.8); // Call IEnumerable <MapFeature> features = GrassCoverErosionOutwardsMapDataFeaturesFactory.CreateCalculationFeatures(new[] { calculationA, calculationB }); // Assert Assert.AreEqual(2, features.Count()); Assert.AreEqual(1, features.ElementAt(0).MapGeometries.Count()); Assert.AreEqual(1, features.ElementAt(1).MapGeometries.Count()); AssertEqualPointCollections(new[] { new Point2D(1.0, 3.0), new Point2D(5.0, 4.0) }, features.ElementAt(0).MapGeometries.ElementAt(0)); AssertEqualPointCollections(new[] { new Point2D(1.0, 4.0), new Point2D(2.2, 3.8) }, features.ElementAt(1).MapGeometries.ElementAt(0)); }
private void SetCalculationsMapData() { IEnumerable <GrassCoverErosionOutwardsWaveConditionsCalculation> calculations = FailureMechanism.CalculationsGroup.GetCalculations().Cast <GrassCoverErosionOutwardsWaveConditionsCalculation>(); calculationsMapData.Features = GrassCoverErosionOutwardsMapDataFeaturesFactory.CreateCalculationFeatures(calculations); }
public void CreateCalculationFeatures_CalculationsNull_ReturnsEmptyFeaturesCollection() { // Call IEnumerable <MapFeature> features = GrassCoverErosionOutwardsMapDataFeaturesFactory.CreateCalculationFeatures(null); // Assert CollectionAssert.IsEmpty(features); }
public void CreateCalculationFeatures_NoCalculations_ReturnsEmptyFeaturesCollection() { // Call IEnumerable <MapFeature> features = GrassCoverErosionOutwardsMapDataFeaturesFactory.CreateCalculationFeatures( Enumerable.Empty <GrassCoverErosionOutwardsWaveConditionsCalculation>()); // Assert CollectionAssert.IsEmpty(features); }