Antlr4.Test.StringTemplate.TestDictionaries.TestDictKeyLookupAsNonToStringableObject C# (CSharp) Метод

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

private TestDictKeyLookupAsNonToStringableObject ( ) : void
Результат void
        public void TestDictKeyLookupAsNonToStringableObject()
        {
            // Make sure we try rendering stuff to string if not found as regular object
            string templates =
                    "foo(m,k) ::= \"<m.(k)>\"" + newline
                    ;
            writeFile(tmpdir, "test.stg", templates);
            TemplateGroup group = new TemplateGroupFile(Path.Combine(tmpdir, "test.stg"));
            Template st = group.GetInstanceOf("foo");
            IDictionary<HashableUser, string> m = new Dictionary<HashableUser, string>();
            m[new HashableUser(99, "parrt")] = "first";
            m[new HashableUser(172036, "tombu")] = "second";
            m[new HashableUser(391, "sriram")] = "third";
            st.Add("m", m);
            st.Add("k", new HashableUser(172036, "tombu"));
            string expecting = "second";
            string result = st.Render();
            Assert.AreEqual(expecting, result);
        }