예제 #1
0
        private ShapeRecord[] GenerateManyRecords(ShapeType typeOfShape, ShapeRecordCount count)
        {
            var records = new ShapeRecord[count.ToInt32()];
            var number  = RecordNumber.Initial;

            for (var index = 0; index < records.Length; index++)
            {
                ShapeContent content = null;
                switch (typeOfShape)
                {
                case ShapeType.Point:
                    content = new PointShapeContent(_fixture.Create <PointM>());
                    break;

                case ShapeType.PolyLineM:
                    content = new PolyLineMShapeContent(_fixture.Create <MultiLineString>());
                    break;

                //case ShapeType.NullShape:
                default:
                    content = NullShapeContent.Instance;
                    break;
                }

                records[index] = content.RecordAs(number);
                number         = number.Next();
            }

            return(records);
        }
예제 #2
0
 public ShapeFileHeader ForIndex(ShapeRecordCount recordCount)
 {
     return(new ShapeFileHeader(
                Length.Plus(ShapeIndexRecord.Length.Times(recordCount.ToInt32())),
                ShapeType,
                BoundingBox
                ));
 }
예제 #3
0
        public void ToStringReturnsExpectedValue()
        {
            var value = _fixture.Create <int>().AsShapeRecordCountValue();
            var sut   = new ShapeRecordCount(value);

            var result = sut.ToString();

            Assert.Equal(value.ToString(), result);
        }