ABB.Swum.Tests.ContextBuilderTests.TestBuildMethodContext_InlineFunctionInStruct C# (CSharp) Метод

TestBuildMethodContext_InlineFunctionInStruct() приватный Метод

private TestBuildMethodContext_InlineFunctionInStruct ( ) : void
Результат void
        public void TestBuildMethodContext_InlineFunctionInStruct() {
            string testSrcML = "<struct>struct <name>MyStruct</name> <block>{<public type=\"default\"> <function><type><name>int</name></type> <name>foo</name><parameter_list>()</parameter_list> <block>{<return>return <expr><lit:literal type=\"number\">0</lit:literal></expr>;</return>}</block></function> </public>}</block>;</struct>";
            XElement xml = XElement.Parse(string.Format(srcMLFormat, testSrcML), LoadOptions.PreserveWhitespace);

            MethodContext mc1 = new MethodContext("int", true, "MyStruct", new List<FormalParameterRecord>(), false, false, false);
            MethodContext mc2 = ContextBuilder.BuildMethodContext(xml.Descendants(SRC.Function).First());
            Assert.IsTrue(MethodContextsAreEqual(mc1, mc2));
        }