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()); }
public void TestDesAdapterByNong() { Adaptee adaptee = new Adaptee(); ITarget target = new Adapterr(adaptee); var result = target.GetRequest(); Assert.Equal("This is 'Specific request.'", result); }
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()); }