-
-
Save drewfreyling/7018165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void DeserializeTest() | |
{ | |
const string json = "{\"a\":\"test\"}"; //already stringifyied | |
var result = ServiceStack.Text.JsonSerializer.DeserializeFromString<dynamic>(json); | |
Assert.AreEqual("test", result.a); | |
} | |
[TestMethod] | |
public void SerializeTest() | |
{ | |
const string json = "{\"a\":\"test\"}"; | |
var notjson = new { a = "test" }; | |
var result = ServiceStack.Text.JsonSerializer.SerializeToString(notjson); | |
Assert.AreEqual(json, result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment