public void ReceiveSuccessfulFingersTest(int[] selectedFingers, bool hold) { string expectedFingers = String.Join(",", selectedFingers.Select(p => p.ToString()).ToArray()); string expectedHold = hold.ToString(); StartMovementMockServer(expectedFingers, hold); WirelessCommand command = new WirelessCommand("localhost:" + mockServer.Ports[0]); string actualFingers = command.Request(command.MoveFingers(selectedFingers, hold)).GetAwaiter().GetResult()["fingers"]; string actualHold = command.Request(command.MoveFingers(selectedFingers, hold)).GetAwaiter().GetResult()["hold"]; Assert.Equal(expectedFingers, actualFingers); Assert.Equal(expectedHold, actualHold); StopMockServer(); }
public void ReceiveSuccessfulStatusCheck() { StartStatusMockServer(); WirelessCommand command = new WirelessCommand("localhost:" + mockServer.Ports[0]); Dictionary <string, string> actual = new Dictionary <string, string>(); string expected = "success"; actual = command.Request(command.StatusCheck()).GetAwaiter().GetResult(); Assert.Equal(expected, actual["status"]); StopMockServer(); }