private static CompatibleObject Map(Adaptee.IncompatibleObject @object) { return new CompatibleObject { DateTime = new DateTime(@object.Year, @object.Month, @object.Day, new GregorianCalendar()) }; }
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))); }
public Adapter(Adaptee component) { _component = component; }
public Adapter(Adaptee adaptee) { m_Adaptee = adaptee; }
public Adapter(Adaptee component) { _component = component; }
public Adapter(Adaptee adaptee) { this._adaptee = adaptee; }