private static void TurkeyTestDrive() { IDuck duck = new MallardDuck(); ITurkey duckAdapter = new DuckAdapter(duck); for (int i = 0; i < 10; i++) { Console.WriteLine("The DuckAdapter says..."); duckAdapter.Gobble(); duckAdapter.Fly(); } }
static void Main() { IDuck duck = new MallardDuck(); duck.Quack(); duck.Fly(); ITurkey turkey = new WildTurkey(); turkey.Gobble(); turkey.Fly(); IDuck adapter = new DuckAdapter(turkey); adapter.Quack(); adapter.Fly(); Console.ReadLine(); }