Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public OnHoldState(CellPhone phone)
 {
     _phone = phone;
 }
Esempio n. 3
0
 public InCallState(CellPhone phone)
 {
     _phone = phone;
 }
Esempio n. 4
0
 public OffState(CellPhone phone)
 {
     _phone = phone;
 }