static void Main() { var door = new SecuredDoor(new LabDoor()); door.Open("hunter2"); door.Close(); door.Open("$3CRET"); door.Close(); }
static void Main(string[] args) { IDoor labdoor = new LabDoor(); SecuredDoor securedoor = new SecuredDoor(labdoor); securedoor.Open("random"); securedoor.Open("secret"); securedoor.Close(); Console.ReadKey(); }
static void Main(string[] args) { var door = new SecuredDoor(new WoodDoor()); Console.WriteLine("Now open the door"); door.Open("correct_key"); Console.WriteLine("\n"); Console.WriteLine("Now close the door"); door.Close(); Console.ReadKey(); }