Esempio n. 1
0
        public void CannotCreateForNonDelegate()
        {
            string         msg    = Assert.Throws <ArgumentException>(() => CallSite <Expression> .Create(null)).Message;
            CallSiteBinder binder = new CallSiteBinderDefaultBehaviourTests.NopCallSiteBinder();

            Assert.Equal(msg, Assert.Throws <ArgumentException>(() => CallSite <Expression> .Create(binder)).Message);
            Assert.Equal(msg, Assert.Throws <ArgumentException>(() => CallSite.Create(typeof(Expression), binder)).Message);
        }
Esempio n. 2
0
        public void NonGenericCreateNullType()
        {
            CallSiteBinder binder = new CallSiteBinderDefaultBehaviourTests.NopCallSiteBinder();

            Assert.Throws <ArgumentNullException>("delegateType", () => CallSite.Create(null, binder));
        }