private string SponsorToJson(Sponsor x) => $"{{" + $"'id':{x.Id}," + $"'sponsoredEvent':{EventJsonConverterTests.EventToJson( x.SponsoredEvent )}," + $"'sponsoringCompany':{CompanyJsonConverterTests.CompanyToJson( x.SponsoringCompany )}," + $"'sponsorshipLevel':{SponsorLevelJsonConverterTests.SponsorLevelToJson( x.SponsorshipLevel )}" + $"}}";
public void JsonDeserializer_ItemsOutOfOrder() { Sponsor expected = CreateSponsor(2015); string json = $"{{" + $"'sponsoringCompany':{CompanyJsonConverterTests.CompanyToJson( expected.SponsoringCompany )}," + $"'sponsoredEvent':{EventJsonConverterTests.EventToJson( expected.SponsoredEvent )}," + $"'id':{expected.Id}," + $"'sponsorshipLevel':{SponsorLevelJsonConverterTests.SponsorLevelToJson( expected.SponsorshipLevel )}" + $"}}"; Sponsor actual = JsonConvert.DeserializeObject <Sponsor>(json); Assert.Equal(expected, actual); }