public void ShouldCreateAProperArray() { var newPolygon = new Polygon(new List<Ring> { this._validRing1, this._validRing2 }); var polygonArray = newPolygon.ToArray(); polygonArray.Should().Not.Be.Null(); polygonArray.GetType().Should().Be<double[][][]>(); polygonArray.Length.Should().Be(2); polygonArray[0].Length.Should().Be(5); polygonArray[1].Length.Should().Be(4); }
public void ShouldCreateAProperPolygonWithTheCorrectlyParameters() { var newPolygon = new Polygon(new List<Ring> { this._validRing1, this._validRing2 }); newPolygon.Should() .Not.Be.Null() .And.Be.OfType<Polygon>(); newPolygon.Rings.Should().Not.Be.Null(); newPolygon.Rings.Count.Should().Be(2); newPolygon.Rings[0].Should().Not.Be.Null(); newPolygon.Rings[0].Equals(this._validRing1).Should().Be(true); newPolygon.Rings[1].Should().Not.Be.Null(); newPolygon.Rings[1].Equals(this._validRing2).Should().Be(true); }
private RestAPIFeature<Polygon, RestAPITestAttributeModel> CreateSingleFeature() { var testName = CreateFeatureName(); var ring = new Ring(new List<SimplePoint> { this._point1, this._point2, this._point3, this._point1 }); var polygonToAdd = new Polygon(new List<Ring> { ring }); var attributesToAdd = new RestAPITestAttributeModel { Name = testName, Description = testName }; var featureToAdd = new RestAPIFeature<Polygon, RestAPITestAttributeModel> { Attributes = attributesToAdd, Geometry = polygonToAdd }; return featureToAdd; }