Last active
December 31, 2015 03:29
-
-
Save makomweb/7927801 to your computer and use it in GitHub Desktop.
Testing different serializers with xUnit.net.
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
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