public void JsonModel_SeresBasic_ShouldDeserializeAndValidate() { var json = EmbeddedResource.LoadDataFromEmbeddedResourceAsString(SERESBASIC_JSON_RESOURCE); _TestData.Model.CSharp.melding melding = JsonSerializer.Deserialize <_TestData.Model.CSharp.melding>(json); melding.E1.Should().Be("Yo"); }
public void XmlModel_SeresBasic_ShouldValidate() { var xml = EmbeddedResource.LoadDataFromEmbeddedResourceAsString(SERESBASIC_XML_RESOURCE); var validXml = ValidateXml(xml); validXml.Should().BeTrue(); }
public async Task JsonModel_SeresBasic_ShouldValidate() { var json = EmbeddedResource.LoadDataFromEmbeddedResourceAsString(SERESBASIC_JSON_RESOURCE); var jsonSchema = await EmbeddedResource.LoadDataFromEmbeddedResourceAsJsonSchema(SERESBASIC_JSON_SCHEMA_RESOURCE); var jsonDocument = JsonDocument.Parse(json); var validationResults = jsonSchema.Validate(jsonDocument.RootElement, new ValidationOptions() { OutputFormat = OutputFormat.Detailed }); validationResults.IsValid.Should().BeTrue(); }