コード例 #1
0
        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());
            }
        }
コード例 #2
0
        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());
            }
        }
コード例 #3
0
        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());
            }
        }
コード例 #4
0
        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());
            }
        }