Example #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);
        }
Example #2
0
 public ShapeFileHeader ForIndex(ShapeRecordCount recordCount)
 {
     return(new ShapeFileHeader(
                Length.Plus(ShapeIndexRecord.Length.Times(recordCount.ToInt32())),
                ShapeType,
                BoundingBox
                ));
 }
Example #3
0
        public void ToInt32ReturnsExpectedValue()
        {
            var value = _fixture.Create <int>().AsShapeRecordCountValue();
            var sut   = new ShapeRecordCount(value);

            var result = sut.ToInt32();

            Assert.Equal(value, result);
        }