public void Deserialize_Float() { // arrange var type = new IdType(); float serialized = 1.1f; // act bool success = type.TryDeserialize(serialized, out object value); // assert Assert.False(success); }
public void Deserialize_Null() { // arrange var type = new IdType(); object serialized = null; // act bool success = type.TryDeserialize(serialized, out object value); // assert Assert.Null(value); }
public void Deserialize_Int() { // arrange var type = new IdType(); var serialized = 123456; // act bool success = type.TryDeserialize(serialized, out object value); // assert Assert.True(success); Assert.Equal("123456", Assert.IsType<string>(value)); }
public void Deserialize_Int() { // arrange IdType type = SchemaBuilder.New() .AddQueryType(c => c .Name("QueryRoot") .Field("abc") .Type <IdType>() .Resolve("abc")) .Create() .GetType <IdType>("ID"); var serialized = 123456; // act bool success = type.TryDeserialize(serialized, out object value); // assert Assert.True(success); Assert.Equal("123456", Assert.IsType <string>(value)); }