public void RepresentASingleResourceObject() { var instance = JDocument.For(new JResource("dwarf", "gimly")); var result = instance.ToString(Newtonsoft.Json.Formatting.None); result.Should().Be("{\"data\":{\"type\":\"dwarf\",\"id\":\"gimly\"}}"); }
public void RepresentAnEmptyArrayOfResourceObjects() { var instance = JDocument.For(new JResource[] { }); var result = instance.ToString(Newtonsoft.Json.Formatting.None); result.Should().Be("{\"data\":[]}"); }
public void RepresentASingleNullResourceObject() { var instance = JDocument.For(resource: default(JResource)); var result = instance.ToString(Newtonsoft.Json.Formatting.None); result.Should().Be("{\"data\":null}"); }
public void RepresentAnArrayOfResourceObjects() { var instance = JDocument.For(new[] { new JResource("dwarf", "gimly"), new JResource("dwarf", "thorin") }); var result = instance.ToString(Newtonsoft.Json.Formatting.None); result.Should().Be("{\"data\":[{\"type\":\"dwarf\",\"id\":\"gimly\"},{\"type\":\"dwarf\",\"id\":\"thorin\"}]}"); }