Skip to content

Instantly share code, notes, and snippets.

@mattjohnsonpint
Created July 4, 2015 00:30
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 mattjohnsonpint/0a21d5640f65ddcbf930 to your computer and use it in GitHub Desktop.
Save mattjohnsonpint/0a21d5640f65ddcbf930 to your computer and use it in GitHub Desktop.
xUnit / Json issue
using Newtonsoft.Json;
using Xunit;
using Xunit.Abstractions;
namespace XUnitJsonTest
{
public class Class1
{
private readonly ITestOutputHelper _output;
public Class1(ITestOutputHelper output)
{
_output = output;
}
[Fact]
public void Test1()
{
var foo = new { Foo = "Bar" };
var json = JsonConvert.SerializeObject(foo);
_output.WriteLine(json);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment