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()); }
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()); }
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); }
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); }