コード例 #1
0
ファイル: AdapterTests.cs プロジェクト: npoxon/DesignPatterns
        public void AdapterTest()
        {
            var adaptee = new Adaptee();
            var target  = new Adapter.Adapter(adaptee);

            target.GetRequest().Should().Be(StructuralText.SpecificText);
        }
コード例 #2
0
        public void Main()
        {
            var     adaptee = new Adaptee();
            ITarget target  = new Adapter.Adapter(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());
        }