Esempio n. 1
0
        public void FromBytesWithEncodingHasExpectedResult()
        {
            var sut = new PolyLineMShapeContent(_fixture.Create <MultiLineString>());

            var result = ShapeContent.FromBytes(sut.ToBytes(Encoding.UTF8), Encoding.UTF8);

            var actual = Assert.IsType <PolyLineMShapeContent>(result);

            Assert.Equal(sut.Shape, actual.Shape);
            Assert.Equal(sut.ShapeType, actual.ShapeType);
            Assert.Equal(sut.ContentLength, actual.ContentLength);
        }
Esempio n. 2
0
        public void ToBytesWithEncodingHasExpectedResult()
        {
            var sut = new PolyLineMShapeContent(_fixture.Create <MultiLineString>());

            var result = sut.ToBytes(Encoding.UTF8);

            using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream, Encoding.UTF8))
                {
                    sut.Write(writer);
                    writer.Flush();

                    Assert.Equal(stream.ToArray(), result);
                }
        }