public void TestPropertyGetCachedResult()
        {
            Type        t     = typeof(Sample1);
            MethodCache cache = new MethodCache();

            PropertyInfo       p1 = t.GetProperty("Prop");
            InvocationDelegate d1 = cache.GetGetter(p1);

            PropertyInfo       p2 = t.GetProperty("Prop");
            InvocationDelegate d2 = cache.GetGetter(p2);

            Assert.AreSame(p1, p2);
            Assert.AreSame(d1, d2);
        }
Exemplo n.º 2
0
        public void TestPropertyGetCachedResult()
        {
            Type t = typeof(Sample1);
            MethodCache cache = new MethodCache();

            PropertyInfo p1 = t.GetProperty("Prop");
            InvocationDelegate d1 = cache.GetGetter(p1);

            PropertyInfo p2 = t.GetProperty("Prop");
            InvocationDelegate d2 = cache.GetGetter(p2);

            Assert.AreSame(p1, p2);
            Assert.AreSame(d1, d2);
        }