Пример #1
0
 public void InterfaceProperty()
 {
     PropertyInfo property = null;
     IPropertyClass proxy = new InterfacePropertyClass(new InvocationHandler(invocation =>
     {
         property = invocation.Property;
         return Task.FromResult<object>(null);
     }));
     proxy.Property = "foo";
     Assert.AreEqual(nameof(IPropertyClass.Property), property.Name.Split('.').Last());
 }
Пример #2
0
        public void InterfaceProperty()
        {
            PropertyInfo   property = null;
            IPropertyClass proxy    = new InterfacePropertyClass(new InvocationHandler(invocation =>
            {
                property = invocation.Property;
                return(Task.FromResult <object>(null));
            }));

            proxy.Property = "foo";
            Assert.AreEqual(nameof(IPropertyClass.Property), property.Name.Split('.').Last());
        }