public void checkPingPong(JObject message) { if (message?["ping"]?.ToString() == "0") { IdVObject obj = new IdVObject(); obj.id = "RP5-00-(000)"; obj.version = "5.6.2.83"; SendMessageToServer(obj); } }
public void CheckConnectionFirstMessageError() { adapter.ConnectTeacher(); IdVObject obj = new IdVObject(); obj.id = "NEgativeGUID"; obj.version = "5.6.2.83"; adapter.SendMessageToServer(obj); JObject mes = adapter.RecieveMessage(); Assert.AreEqual("NEgativeGUID", mes?["id"]?.Value <string>()); }
public void CheckConnectionThirdMessage() { //Проверка третьего сообщения сервера adapter.ConnectTeacher(); IdVObject obj = new IdVObject(); obj.id = "RP5-00-(000)"; obj.version = "5.6.2.83"; adapter.SendMessageToServer(obj); JObject mes = adapter.RecieveAwaytingMessage("client_disconn", "100"); Assert.AreEqual("RP5-00-(000)", mes?["id"]?.Value <string>()); }
public void CheckConnectionFirstMessage() { //Проверка первого сообщения сервера adapter.ConnectTeacher(); IdVObject obj = new IdVObject(); obj.id = "RP5-00-(000)"; obj.version = "5.6.2.83"; adapter.SendMessageToServer(obj); JObject mes = adapter.RecieveMessage(); Assert.AreEqual("0", mes?["exercise_id"]?.Value <string>()); Assert.AreEqual("RP5-00-(000)", mes?["id"]?.Value <string>()); Assert.AreEqual("5.6.2.6487.1119", mes?["version"]?.Value <string>()); }
public void TestPingPong() { //Проверка пинга глубиной в 10 adapter.ConnectTeacher(); IdVObject obj = new IdVObject(); obj.id = "RP5-00-(000)"; obj.version = "5.6.2.83"; adapter.SendMessageToServer(obj); for (int i = 0; i < 10; i++) { while (true) { JObject response = adapter.RecieveMessage(); if (response?["ping"]?.ToString() == "0") { adapter.checkPingPong(response); break; } } } Assert.True(true); }