Skip to content

Instantly share code, notes, and snippets.

@makomweb
Last active December 31, 2015 03:29
Show Gist options
  • Save makomweb/7927801 to your computer and use it in GitHub Desktop.
Save makomweb/7927801 to your computer and use it in GitHub Desktop.
Testing different serializers with xUnit.net.
public class SerializerTests
{
public static IEnumerable<object[]> Serializers
{
get
{
yield return new object[] { new NewtonsoftJson() };
yield return new object[] { new ServiceStackJson() };
}
}
[Theory]
[PropertyData("Serializers")]
public async Task Deserialize_should_succeed(ISerializer serializer)
{
var obj = serializer.DeserializeObject<Dictionary<string, string>>("{ \"key_1\": \"value_1\", \"key_2\": \"value_2\", \"key_3\": \"value_3\" }");
obj.Should().NotBeNull();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment