Пример #1
0
        protected void Longitude_ExpectParseResultToMatchNull()
        {
            // arrange
            ScalarType scalar      = new LongitudeType();
            object     valueSyntax = null !;

            // act
            IValueNode result = scalar.ParseResult(valueSyntax);

            // assert
            Assert.Equal(typeof(NullValueNode), result.GetType());
        }
Пример #2
0
        protected void Longitude_ExpectParseResultToMatchDouble()
        {
            // arrange
            ScalarType   scalar      = new LongitudeType();
            const double valueSyntax = 179d;

            // act
            IValueNode result = scalar.ParseResult(valueSyntax);

            // assert
            Assert.Equal(typeof(StringValueNode), result.GetType());
        }
Пример #3
0
        protected void Longitude_ExpectParseResultToThrowOnInvalidType()
        {
            // arrange
            ScalarType scalar      = new LongitudeType();
            const char valueSyntax = 'c';

            // act
            Exception?result = Record.Exception(() => scalar.ParseResult(valueSyntax));

            // assert
            Assert.IsType <SerializationException>(result);
        }
Пример #4
0
        protected void Longitude_ExpectParseResultToThrowOnInvalidString()
        {
            // arrange
            ScalarType   scalar      = new LongitudeType();
            const string valueSyntax = "-181° 0' 0.000\" W" !;

            // act
            Exception?result = Record.Exception(() => scalar.ParseResult(valueSyntax));

            // assert
            Assert.IsType <SerializationException>(result);
        }