Skip to content

Instantly share code, notes, and snippets.

@kmorcinek
Created September 29, 2016 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmorcinek/39926c6a7e8709c7c8ad634c542ed53c to your computer and use it in GitHub Desktop.
Save kmorcinek/39926c6a7e8709c7c8ad634c542ed53c to your computer and use it in GitHub Desktop.
using Newtonsoft.Json;
using Xunit;
[Fact]
public void SerializationTest()
{
var money = Money.Create(1, "USD");
string json = JsonConvert.SerializeObject(money);
Money result = JsonConvert.DeserializeObject<Money>(json);
Assert.Equal(money.Currency, result.Currency);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment