예제 #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();
        }
예제 #3
0
 public void BuildtimeAggregateExceptionTest()
 {
     // Exception here.
     //
     IOptionalInterface duck1 = DuckTyping.Aggregate <IOptionalInterface>(string.Empty, Guid.Empty);
 }
예제 #4
0
 public void BuildtimeExceptionTest()
 {
     // Exception here.
     //
     IOptionalInterface duck1 = DuckTyping.Implement <IOptionalInterface> (string.Empty);
 }