Exemplo n.º 1
0
        protected void Latitude_ExpectParseResultToMatchNull()
        {
            // arrange
            ScalarType scalar      = new LatitudeType();
            object     valueSyntax = null !;

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

            // assert
            Assert.Equal(typeof(NullValueNode), result.GetType());
        }
Exemplo n.º 2
0
        protected void Latitude_ExpectParseResultToMatchDouble()
        {
            // arrange
            ScalarType   scalar      = new LatitudeType();
            const double valueSyntax = 89d;

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

            // assert
            Assert.Equal(typeof(StringValueNode), result.GetType());
        }
Exemplo n.º 3
0
        protected void Latitude_ExpectParseResultToThrowOnInvalidType()
        {
            // arrange
            ScalarType scalar      = new LatitudeType();
            const char valueSyntax = 'c';

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

            // assert
            Assert.IsType <SerializationException>(result);
        }
Exemplo n.º 4
0
        protected void Latitude_ExpectParseResultToThrowOnInvalidString()
        {
            // arrange
            ScalarType scalar      = new LatitudeType();
            var        valueSyntax = "92° 0' 0.000\" S";

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

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