начало кодгена
This commit is contained in:
@@ -116,4 +116,49 @@ public class TestParameter
|
||||
{
|
||||
public int A { get; set; }
|
||||
public TransmittedSharedObject<ITestParameter> LinkedObject { get; set; }
|
||||
}
|
||||
|
||||
public class TestControllerRemoteEndoint : ITestController, IRemoteObject
|
||||
{
|
||||
public TestControllerRemoteEndoint(int id)
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
public void A()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Task AAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int B()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Task<int> BAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TransmittedSharedObject<ITestController> SharedObjectTransmitionTest()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int Parametrized(TestParameter parameter)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TransmittedSharedObject<ITestParameter> GetTestParameter()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private int _id;
|
||||
public int Id => _id;
|
||||
}
|
||||
+17
-7
@@ -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()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,12 +5,12 @@
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mikhail\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Mimm\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.12.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Mikhail\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Users\Mimm\.nuget\packages\" />
|
||||
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
@@ -21,6 +21,6 @@
|
||||
<Import Project="$(NuGetPackageRoot)microsoft.net.test.sdk\17.12.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props" Condition="Exists('$(NuGetPackageRoot)microsoft.net.test.sdk\17.12.0\build\netcoreapp3.1\Microsoft.NET.Test.Sdk.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgNUnit_Analyzers Condition=" '$(PkgNUnit_Analyzers)' == '' ">C:\Users\Mikhail\.nuget\packages\nunit.analyzers\4.6.0</PkgNUnit_Analyzers>
|
||||
<PkgNUnit_Analyzers Condition=" '$(PkgNUnit_Analyzers)' == '' ">C:\Users\Mimm\.nuget\packages\nunit.analyzers\4.6.0</PkgNUnit_Analyzers>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user