示例#1
0
        public void ParseValue_With_Noncoordinate_Throws()
        {
            // arrange
            var type = new GeoJsonPositionType();
            var item = "this is not a coordinate";

            // act
            // assert
            Assert.Throws <SerializationException>(() => type.ParseValue(item));
        }
示例#2
0
        public void ParseValue_With_Null()
        {
            // arrange
            var type = new GeoJsonPositionType();

            // act
            IValueNode result = type.ParseValue(null);

            // assert
            Assert.Null(Assert.IsType <NullValueNode>(result).Value);
        }
示例#3
0
        public void ParseValue_With_2Valid_Coordinates()
        {
            // arrange
            var type       = new GeoJsonPositionType();
            var coordinate = new Coordinate(1.1, 2.2);

            // act
            IValueNode result = type.ParseValue(coordinate);

            // assert
            Assert.Equal("1.1", Assert.IsType <ListValueNode>(result).Items[0].Value);
            Assert.Equal("2.2", Assert.IsType <ListValueNode>(result).Items[1].Value);
        }