public void CanSerializeListWithEmbeddedWithLinksWithEmbeddedJsonProperty() { var original = TestListEmbeddedPropertyParentsResource.Default1(); var json = JsonConvert.SerializeObject(original, _settings); const string expected = TestListEmbeddedPropertyParentsResource.SerializedDefault1; var deserialized = JsonConvert.DeserializeObject <TestListEmbeddedPropertyParentsResource>(json, _settings); json.ShouldNotBeNullOrWhiteSpace(); json.ShouldBe(expected, StringCompareShould.IgnoreCase); original.ShouldBe(deserialized); }
public async Task CanDeserializeListWithEmbeddedWithLinksWithEmbeddedJsonProperty() { using (var server = LocalWebServer.ListenInBackground(new XUnitMockLogger(_logger))) { var uri = server.ListeningUri; server.WithNextResponse(new MockHttpResponseMessage().WithContent(TestListEmbeddedPropertyParentsResource.SerializedDefault1).WithPrivateCacheHeader().WithDefaultExpiration()); var result = await CreateBuilder() .WithLink(uri).ResultAsync <TestListEmbeddedPropertyParentsResource>(); result.ShouldNotBeNull(); result.ShouldBe(TestListEmbeddedPropertyParentsResource.Default1()); } }