public async Task TestWithObjectWithParentAndChild(string testin, Int64 postId, ContextDataEnum contextData) { XmlFileContext<SampleContext> xmlFileCtx = new XmlFileContext<SampleContext>(this.GetType()); using (SampleContext ctx = xmlFileCtx.InputContext(testin, "as-xml-tests")) { ctx.Posts.Find(postId); String xml_result_exepcted = GetOutFileContent(testin + contextData.ToString("G") + postId, "as-xml-tests"); string xml_result_actual = await ctx.AsXmlAsync(contextData); var result = await xmlFileCtx.Compare(xml_result_actual, xml_result_exepcted); result.AreEqual.ShouldBe(true, result.ToString()); } }
public async Task TestWithObjectWithParentAndChild(string testin, Int64 postId, ContextDataEnum contextData) { XmlFileContext <SampleContext> xmlFileCtx = new XmlFileContext <SampleContext>(this.GetType()); using (SampleContext ctx = xmlFileCtx.InputContext(testin, "as-xml-tests")) { ctx.Posts.Find(postId); String xml_result_exepcted = GetOutFileContent(testin + contextData.ToString("G") + postId, "as-xml-tests"); string xml_result_actual = await ctx.AsXmlAsync(contextData); var result = await xmlFileCtx.Compare(xml_result_actual, xml_result_exepcted); result.AreEqual.ShouldBe(true, result.ToString()); } }
public async Task TestLoadingChilds(string testin, Int64 autId, ContextDataEnum contextData) { XmlFileContext <SampleContext> xmlFileCtx = new XmlFileContext <SampleContext>(this.GetType()); string testOut = testin + contextData.ToString("G") + autId; using (SampleContext ctx = xmlFileCtx.InputContext(testin, "as-xml-tests")) { ctx.Authors.Find(autId); String xml_result_exepcted = GetOutFileContent(testOut, "as-xml-tests"); string xml_result_actual = await ctx.AsXmlAsync(contextData); var result = await xmlFileCtx.Compare(xml_result_actual, xml_result_exepcted); result.AreEqual.ShouldBe(true, result.ToString()); } }
public async Task TestLoadingChilds(string testin, Int64 autId, ContextDataEnum contextData) { XmlFileContext<SampleContext> xmlFileCtx = new XmlFileContext<SampleContext>(this.GetType()); string testOut = testin + contextData.ToString("G") + autId; using (SampleContext ctx = xmlFileCtx.InputContext(testin, "as-xml-tests")) { ctx.Authors.Find(autId); String xml_result_exepcted = GetOutFileContent(testOut,"as-xml-tests"); string xml_result_actual = await ctx.AsXmlAsync(contextData); var result = await xmlFileCtx.Compare(xml_result_actual, xml_result_exepcted); result.AreEqual.ShouldBe(true, result.ToString()); } }