Example #1
0
 public void GivenIHaveARunningMonkeyTalkRemoteAtLocation(string location)
 {
     if (location == "mock")
     {
         _mock = new Moq.Mock<IChimpRemote>();
     }
     else
     {
         chimpRemoteDevice = new ChimpRemote(location, string.Empty); //string.Empty should be deviceIp from Devs config file.
     }
     if (_payload == null) _payload = new MonkeyTalkWirePayload();
 }
Example #2
0
        public void WhenISendAActionWithThePayload(string p0)
        {
            ChimpAction action = ChimpAction.Tap;
            Enum.TryParse<ChimpAction>(p0, out action);
            _payload.action = action;

            if (_mock != null)
            {
                _mock.Setup(x => x.Play(_payload))
                    .Returns(new ChimpReturnMessage() { result = "OK" });

                chimpRemoteDevice = _mock.Object;
            }

            chimpReturnMessage = chimpRemoteDevice.Play(_payload);

            //app.Button("butonId").Tap().With("ssasasas");
        }
Example #3
0
 public void WhenISendASimplePlayCommandPayload()
 {
     //default payload - Tap and call Play
     _payload = new MonkeyTalkWirePayload() { action = ChimpAction.Tap, mtcommand = MonkeyTalkCommand.PLAY };
     _mock.Setup(x => x.Play(_payload)).Returns(new ChimpReturnMessage() { result = "OK", message = "mocked test result" });
     chimpRemoteDevice = _mock.Object;
     chimpReturnMessage = chimpRemoteDevice.Play(_payload);
 }