public void ShowPattern() { CellPhone phone = new CellPhone(); //Should return "Already off" var shouldAlreadyBeOff = phone.TurnOff(); //Turn On var successTurningOn = phone.TurnOn(); //Turning On Again ShouldFail var shouldAlreadyBeOn = phone.TurnOn(); //Making A call should be successfull var successMakingCall = phone.MakeCall(); //Making another Call should fail var shouldAlreadyBeOnCall = phone.MakeCall(); var successPlacingOnHold = phone.PlaceCallOnHold(); var failTurningOff = phone.TurnOff(); var successHangingUp = phone.HangUp(); var successTurningPhoneOff = phone.TurnOff(); }
public OnHoldState(CellPhone phone) { _phone = phone; }
public InCallState(CellPhone phone) { _phone = phone; }
public OffState(CellPhone phone) { _phone = phone; }