Add palace service tests, remove standalone client

This commit is contained in:
Liza 2023-03-27 18:02:18 +02:00
parent cec3597629
commit 7e73430179
5 changed files with 0 additions and 136 deletions

View File

@ -1,28 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.22.1"/>
<PackageReference Include="Grpc.Net.Client" Version="2.52.0"/>
<PackageReference Include="Grpc.Tools" Version="2.53.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Pal.Common\Pal.Common.csproj"/>
</ItemGroup>
<ItemGroup>
<Protobuf Include="..\Pal.Common\Protos\account.proto" Link="Protos\account.proto" GrpcServices="Client" Access="Internal"/>
<Protobuf Include="..\Pal.Common\Protos\palace.proto" Link="Protos\palace.proto" GrpcServices="Client" Access="Internal"/>
</ItemGroup>
</Project>

View File

@ -1,34 +0,0 @@
using Grpc.Core;
using Grpc.Net.Client;
using Palace;
namespace Pal.StandaloneClient
{
internal class Program
{
private const string remoteUrl = "http://localhost:5415";
private static readonly Guid accountId = Guid.Parse("ce7b109a-5e29-4b63-ab3e-b6f89eb5e19e"); // manually created account id
static async Task Main(string[] args)
{
GrpcChannel channel = GrpcChannel.ForAddress(remoteUrl);
var accountClient = new Account.AccountService.AccountServiceClient(channel);
var loginReply = await accountClient.LoginAsync(new Account.LoginRequest
{
AccountId = accountId.ToString()
});
if (loginReply == null || !loginReply.Success)
throw new Exception($"Login failed: {loginReply?.Error}");
var headers = new Metadata()
{
{ "Authorization", $"Bearer {loginReply.AuthToken}" }
};
var palaceClient = new Palace.PalaceService.PalaceServiceClient(channel);
var markAsSeenRequest = new MarkObjectsSeenRequest { TerritoryType = 772 };
markAsSeenRequest.NetworkIds.Add("0c635960-0e2e-4ec6-9fb5-443d0e7a3315"); // this is an already existing entry
var markAsSeenReply = await palaceClient.MarkObjectsSeenAsync(markAsSeenRequest, headers: headers);
Console.WriteLine($"Reply = {markAsSeenReply.Success}");
}
}
}

View File

@ -1,6 +0,0 @@
# Palace Pal - Test Client
This is a very simple prototype for a local test client, which is more helpful
in troubleshooting some specific edge cases with the server implementation.
This should eventually be refactored into a test suite.

View File

@ -1,58 +0,0 @@
{
"version": 1,
"dependencies": {
"net7.0": {
"Google.Protobuf": {
"type": "Direct",
"requested": "[3.22.1, )",
"resolved": "3.22.1",
"contentHash": "Ul4gVJWLya83Z8/n3+O4QKhD8ukCCwNLDyoWpUdJSnmzxRe8o3pWiuCzzvN2z/LVH60nozlKpTzhJo3ctI+G4Q=="
},
"Grpc.Net.Client": {
"type": "Direct",
"requested": "[2.52.0, )",
"resolved": "2.52.0",
"contentHash": "hWVH9g/Nnjz40ni//2S8UIOyEmhueQREoZIkD0zKHEPqLxXcNlbp4eebXIOicZtkwDSx0TFz9NpkbecEDn6rBw==",
"dependencies": {
"Grpc.Net.Common": "2.52.0",
"Microsoft.Extensions.Logging.Abstractions": "3.0.3"
}
},
"Grpc.Tools": {
"type": "Direct",
"requested": "[2.53.0, )",
"resolved": "2.53.0",
"contentHash": "vm8iRSAF/4PN9g555iYZwhCQptSE4cZ8xk5W1TQ+JcHwaHSrBhD+P6H4l0+SqqfzuX7sGpjjOMQJXHSyrERTgw=="
},
"Grpc.Core.Api": {
"type": "Transitive",
"resolved": "2.52.0",
"contentHash": "SQiPyBczG4vKPmI6Fd+O58GcxxDSFr6nfRAJuBDUNj+PgdokhjWJvZE/La1c09AkL2FVm/jrDloG89nkzmVF7A==",
"dependencies": {
"System.Memory": "4.5.3"
}
},
"Grpc.Net.Common": {
"type": "Transitive",
"resolved": "2.52.0",
"contentHash": "di9qzpdx525IxumZdYmu6sG2y/gXJyYeZ1ruFUzB9BJ1nj4kU1/dTAioNCMt1VLRvNVDqh8S8B1oBdKhHJ4xRg==",
"dependencies": {
"Grpc.Core.Api": "2.52.0"
}
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "3.0.3",
"contentHash": "m2Jyi/MEn043WMI1I6J1ALuCThktZ93rd7eqzYeLmMcA0bdZC+TBVl0LuEbEWM01dWeeBjOoagjNwQTzOi2r6A=="
},
"System.Memory": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA=="
},
"pal.common": {
"type": "Project"
}
}
}
}

10
Pal.sln
View File

@ -25,8 +25,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github-workflows", "github-
.github\workflows\upload-crowdin.yml = .github\workflows\upload-crowdin.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pal.StandaloneClient", "Pal.StandaloneClient\Pal.StandaloneClient.csproj", "{EDC1C408-D832-4C09-97A2-61B223A84166}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pal.Server.Tests", "Pal.Server.Tests\Pal.Server.Tests.csproj", "{AEC052FA-F178-492C-9A09-ED28DBE1EF5E}"
EndProject
Global
@ -69,14 +67,6 @@ Global
{D0B37096-5BC3-41B0-8D81-203CBA3932B0}.Release|Any CPU.Build.0 = Release|x64
{D0B37096-5BC3-41B0-8D81-203CBA3932B0}.Release|x64.ActiveCfg = Release|x64
{D0B37096-5BC3-41B0-8D81-203CBA3932B0}.Release|x64.Build.0 = Release|x64
{EDC1C408-D832-4C09-97A2-61B223A84166}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Debug|x64.ActiveCfg = Debug|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Debug|x64.Build.0 = Debug|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Release|Any CPU.Build.0 = Release|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Release|x64.ActiveCfg = Release|Any CPU
{EDC1C408-D832-4C09-97A2-61B223A84166}.Release|x64.Build.0 = Release|Any CPU
{AEC052FA-F178-492C-9A09-ED28DBE1EF5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AEC052FA-F178-492C-9A09-ED28DBE1EF5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AEC052FA-F178-492C-9A09-ED28DBE1EF5E}.Debug|x64.ActiveCfg = Debug|Any CPU