Esempio n. 1
0
        private void button7_Click(object sender, EventArgs e)
        {
            WorkerCreator creator = new WorkerCreator();
            BuilderW      builder = new BuilderW();
            Worker        test    = creator.Create(builder, "Игорь А А", 32, 3);
            ITarget       target  = new Adapterr(test);

            MessageBox.Show(target.StartWork());
        }
Esempio n. 2
0
        public void TestDesAdapterByNong()
        {
            Adaptee adaptee = new Adaptee();
            ITarget target  = new Adapterr(adaptee);

            var result = target.GetRequest();

            Assert.Equal("This is 'Specific request.'", result);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Adaptee adaptee = new Adaptee();
            ITarget target  = new Adapterr(adaptee);

            Console.WriteLine("Adaptee interface is incompatible with the client.");
            Console.WriteLine("But with adapter client can call it's method.");

            Console.WriteLine(target.GetRequest());
        }