/// <summary>
        /// Entry point into console application.
        /// </summary>
        private static void Main()
        {
            // Create adapter and place a request
              Target target = new Adapter();
              target.Request();

              // Wait for user
              Console.ReadKey();
        }
Exemplo n.º 2
0
        public void Tests()
        {
            var component = new Adaptee();
            var adapter = new DesignPatterns.Structural.Adapter.Adapter(component);
            var client = new Client(adapter);

            CompatibleObject result = client.Invoke(new CompatibleObject {DateTime = new DateTime(2000, 1, 1)});

            Assert.That(result.DateTime, Is.EqualTo(new DateTime(1, 6, 24)));
        }
Exemplo n.º 3
0
        public void Tests()
        {
            var component = new Adaptee();
            var adapter   = new DesignPatterns.Structural.Adapter.Adapter(component);
            var client    = new Client(adapter);

            CompatibleObject result = client.Invoke(new CompatibleObject {
                DateTime = new DateTime(2000, 1, 1)
            });

            Assert.That(result.DateTime, Is.EqualTo(new DateTime(1, 6, 24)));
        }