Exemplo n.º 1
0
        public void SetDynamicProperty()
        {
            dynamic d = new TestDynamicNameReflective();

            d.DynProp = nameof(d.DynProp);
            AssertExtensions.Throws <ArgumentOutOfRangeException>("value", () => d.DynProp = "I wandered lonely as a cloud.");
        }
Exemplo n.º 2
0
        public void FailToSetDynamicProperty()
        {
            dynamic d = new TestDynamicNameReflective();

            Assert.Throws <RuntimeBinderException>(() => d.notToBeFound = nameof(d.notToBeFound));
        }
Exemplo n.º 3
0
        public void GetDynamicProperty()
        {
            dynamic d = new TestDynamicNameReflective();

            Assert.Equal("DynProp", d.DynProp);
        }
Exemplo n.º 4
0
 public void FailToSetDynamicProperty()
 {
     dynamic d = new TestDynamicNameReflective();
     Assert.Throws<RuntimeBinderException>(() => d.notToBeFound = nameof(d.notToBeFound));
 }
Exemplo n.º 5
0
 public void SetDynamicProperty()
 {
     dynamic d = new TestDynamicNameReflective();
     d.DynProp = nameof(d.DynProp);
     Assert.Throws<ArgumentOutOfRangeException>("value", () => d.DynProp = "I wandered lonely as a cloud.");
 }
Exemplo n.º 6
0
 public void GetDynamicProperty()
 {
     dynamic d = new TestDynamicNameReflective();
     Assert.Equal("DynProp", d.DynProp);
 }