public void RuntimeAggregateExceptionTest() { IOptionalInterface duck = DuckTyping.Aggregate <IOptionalInterface>(new TestClass(), new EmptyClass()); Assert.AreEqual(1, duck.RequiredMethod()); // Exception here. // duck.OptionalMethod(); }
public void RuntimeExceptionTest() { IOptionalInterface duck = DuckTyping.Implement <IOptionalInterface>(new TestClass()); Assert.AreEqual(1, duck.RequiredMethod()); // Exception here. // duck.OptionalMethod(); }