начало кодгена

This commit is contained in:
2025-02-03 10:06:05 +03:00
parent 3c73701197
commit 1f2df53c12
11 changed files with 152 additions and 32 deletions
+17 -7
View File
@@ -1,5 +1,6 @@
using System.Net;
using System.Net.Sockets;
using System.Text.Json;
using mROA.Implementation;
using mROA.Implementation.Test;
@@ -12,6 +13,7 @@ public class StreamTest
private JsonFrontendSerialisationModule _frontendSerialisationModule;
private ISerialisationModule _serialisationModule;
private IExecuteModule _executeModule;
bool isTestNotFinished = true;
[SetUp]
public void Setup()
@@ -25,12 +27,7 @@ public class StreamTest
_frontendInteractionModule = new StreamBasedFrontendInteractionModule();
_frontendSerialisationModule = new JsonFrontendSerialisationModule(_frontendInteractionModule);
}
[Test]
public void StreamingTest()
{
bool isTestNotFinished = true;
Task.Run(() =>
{
TcpListener listener = new TcpListener(IPAddress.Loopback, 4567);
@@ -44,13 +41,26 @@ public class StreamTest
while (isTestNotFinished) ;
});
}
[Test]
public void StreamingTest()
{
var tcpClient = new TcpClient();
tcpClient.Connect(IPAddress.Loopback, 4567);
_frontendInteractionModule.ServerStream = tcpClient.GetStream();
var req = new JsonCallRequest { CommandId = 1, ObjectId = -1 };
_frontendSerialisationModule.PostCallRequest(req);
var res =_frontendSerialisationModule.GetNextCommandExecution<FinalCommandExecution>(req.CallRequestId).Result;
var res = ((JsonElement)_frontendSerialisationModule.GetNextCommandExecution<FinalCommandExecution>(req.CallRequestId).Result).Deserialize<MockResult>();
isTestNotFinished = false;
Assert.That(res.A == "wqer" && res.B == 5);
}
[Test]
public void RemoteObjectTest()
{
}
}