public void CanSerializeToLong_WithNewtonsoftJsonProvider() { var foo = new NewtonsoftJsonLongId(123); var serializedFoo = NewtonsoftJsonSerializer.SerializeObject(foo); var serializedLong = NewtonsoftJsonSerializer.SerializeObject(foo.Value); Assert.Equal(serializedFoo, serializedLong); }
public void CanDeserializeFromLong_WithNewtonsoftJsonProvider() { var value = 123L; var foo = new NewtonsoftJsonLongId(value); var serializedLong = NewtonsoftJsonSerializer.SerializeObject(value); var deserializedFoo = NewtonsoftJsonSerializer.DeserializeObject <NewtonsoftJsonLongId>(serializedLong); Assert.Equal(foo, deserializedFoo); }