public void CreateStochasticSoilModelFeatures_GivenStochasticSoilModels_ReturnsStochasticSoilModelFeaturesCollection() { // Setup var pointsOne = new[] { new Point2D(1.2, 2.3), new Point2D(2.7, 2.0) }; var pointsTwo = new[] { new Point2D(3.2, 23.3), new Point2D(7.7, 12.6) }; PipingStochasticSoilModel[] stochasticSoilModels = { PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("StochasticSoilModelName1", pointsOne), PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel("StochasticSoilModelName2", pointsTwo) }; // Call IEnumerable <MapFeature> features = PipingMapDataFeaturesFactory.CreateStochasticSoilModelFeatures(stochasticSoilModels); // Assert Assert.AreEqual(stochasticSoilModels.Length, features.Count()); for (var i = 0; i < features.Count(); i++) { Assert.AreEqual(1, features.ElementAt(i).MapGeometries.Count()); AssertEqualPointCollections(stochasticSoilModels[i].Geometry, features.ElementAt(i).MapGeometries.First()); Assert.AreEqual(1, features.ElementAt(i).MetaData.Keys.Count); Assert.AreEqual(stochasticSoilModels[i].Name, features.ElementAt(i).MetaData["Naam"]); } }
public void CreateStochasticSoilModelFeatures_StochasticSoilModelsNull_ReturnsEmptyFeaturesCollection() { // Call IEnumerable <MapFeature> features = PipingMapDataFeaturesFactory.CreateStochasticSoilModelFeatures(null); // Assert CollectionAssert.IsEmpty(features); }
private void SetStochasticSoilModelsMapData() { PipingStochasticSoilModelCollection stochasticSoilModels = FailureMechanism.StochasticSoilModels; stochasticSoilModelsMapData.Features = PipingMapDataFeaturesFactory.CreateStochasticSoilModelFeatures(stochasticSoilModels.ToArray()); }