public async Task TestReturnEmptyXml() { XmlFileContext <SampleContext> xmlFileCtx = new XmlFileContext <SampleContext>(this.GetType()); using (SampleContext emptyContext = xmlFileCtx.Empty()) { Author aut1 = new Author(); aut1.FirstName = "testname"; emptyContext.Authors.Attach(aut1); string fromFile = await emptyContext.AsXmlAsync(DbContextConverterOptions.DEFAULT.WithNullValues()); dynamic obj = fromFile.XmlToDynamic(); ((string)obj.AUTHOR[0].AUT_FIRSTNAME).ShouldBe("testname"); } }
public async Task TestReturnEmptyXml() { XmlFileContext<SampleContext> xmlFileCtx = new XmlFileContext<SampleContext>(this.GetType()); using (SampleContext emptyContext = xmlFileCtx.Empty()) { Author aut1 = new Author(); aut1.FirstName = "testname"; emptyContext.Authors.Attach(aut1); string fromFile = await emptyContext.AsXmlAsync(DbContextConverterOptions.DEFAULT.WithNullValues()); dynamic obj = fromFile.XmlToDynamic(); ((string)obj.AUTHOR[0].AUT_FIRSTNAME).ShouldBe("testname"); } }