예제 #1
0
        public void RuntimeAggregateExceptionTest()
        {
            IOptionalInterface duck = DuckTyping.Aggregate <IOptionalInterface>(new TestClass(), new EmptyClass());

            Assert.AreEqual(1, duck.RequiredMethod());

            // Exception here.
            //
            duck.OptionalMethod();
        }
예제 #2
0
        public void RuntimeExceptionTest()
        {
            IOptionalInterface duck = DuckTyping.Implement <IOptionalInterface>(new TestClass());

            Assert.AreEqual(1, duck.RequiredMethod());

            // Exception here.
            //
            duck.OptionalMethod();
        }