diff --git a/Aurora.sln b/Aurora.sln index 59160f4..2140969 100644 --- a/Aurora.sln +++ b/Aurora.sln @@ -5,6 +5,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aurora", "Aurora\Aurora.csp EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aurora.gtk", "Aurora.gtk\Aurora.gtk.csproj", "{E8C8C24A-5C51-47CB-B241-F5A9F0E808B1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aurora.test", "Aurora.test\Aurora.test.csproj", "{45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|iPhoneSimulator = Debug|iPhoneSimulator @@ -39,5 +41,17 @@ Global {E8C8C24A-5C51-47CB-B241-F5A9F0E808B1}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator {E8C8C24A-5C51-47CB-B241-F5A9F0E808B1}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator {E8C8C24A-5C51-47CB-B241-F5A9F0E808B1}.Release|Any CPU.Build.0 = Release|iPhoneSimulator + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Debug|iPhone.Build.0 = Debug|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Release|iPhone.ActiveCfg = Release|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Release|iPhone.Build.0 = Release|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {45680D8A-1AF1-4D93-AAC0-59CDB01CED5D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/Aurora.test/Aurora.test.csproj b/Aurora.test/Aurora.test.csproj new file mode 100644 index 0000000..9b7378f --- /dev/null +++ b/Aurora.test/Aurora.test.csproj @@ -0,0 +1,24 @@ + + + netcoreapp3.0 + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + \ No newline at end of file diff --git a/Aurora.test/UnitTest1.cs b/Aurora.test/UnitTest1.cs new file mode 100644 index 0000000..48f8c42 --- /dev/null +++ b/Aurora.test/UnitTest1.cs @@ -0,0 +1,31 @@ +using NUnit.Framework; +using Aurora.Proto.PartyV2; +using Aurora.Services.Server; +using Grpc.Core; + +namespace Aurora.test +{ + public class Tests + { + private RemotePartyService.RemotePartyServiceClient _remotePartyService; + private Channel _channel; + [SetUp] + public void Setup() + { + ServerService.Instance.Start("testParty", "asdf"); + _channel = new Channel(string.Format("{0}:{1}", ServerService.GetLocalIPAddress(), 8080), ChannelCredentials.Insecure); + _remotePartyService = new RemotePartyService.RemotePartyServiceClient(_channel); + } + + [Test] + public void Test2() + { + ListMembersResponse resp = _remotePartyService.ListMembers(new ListMembersRequest() + { + Parent = "party1", + PageSize = 10, + }); + Assert.NotNull(resp); + } + } +} \ No newline at end of file diff --git a/Aurora/Aurora.csproj b/Aurora/Aurora.csproj index 7982957..2301ec8 100644 --- a/Aurora/Aurora.csproj +++ b/Aurora/Aurora.csproj @@ -1,158 +1,88 @@ - + netstandard2.0 true - + pdbonly true - - - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + Player.xaml - - - - - - + + + + + + - - - - + + + + - + PreserveNewest - - - - - - + + + + + + \ No newline at end of file diff --git a/Aurora/Services/Server/Controllers/MemberController.cs b/Aurora/Services/Server/Controllers/MemberController.cs index 8c12689..8e95955 100644 --- a/Aurora/Services/Server/Controllers/MemberController.cs +++ b/Aurora/Services/Server/Controllers/MemberController.cs @@ -25,8 +25,15 @@ namespace Aurora.Services.Server.Controllers startIdx = _memberList.IndexOfKey(request.PageToken) + 1; } + //Assign pageSize + if (request.PageSize > _memberList.Count) + { + request.PageSize = _memberList.Count; + } + + //Gather page - List members = (List)_memberList.Values; + List members = new List(_memberList.Values); resp.Members.AddRange(members.GetRange(startIdx, request.PageSize)); //Set next page token diff --git a/Aurora/Services/Server/Controllers/PartyController.cs b/Aurora/Services/Server/Controllers/PartyController.cs index 452cf68..28b28c7 100644 --- a/Aurora/Services/Server/Controllers/PartyController.cs +++ b/Aurora/Services/Server/Controllers/PartyController.cs @@ -26,7 +26,7 @@ namespace Aurora.Services.Server.Controllers this._description = description; this._memberList = new SortedList(); - string userName = SettingsService.Instance.Username; + string userName = "testUser"; this._eventManager = new EventManager.EventManager(); @@ -36,6 +36,8 @@ namespace Aurora.Services.Server.Controllers UserName = userName, IpAddress = ServerService.GetLocalIPAddress(), }; + + this._memberList.Add(_hostMember.Name, _hostMember); } public override Task GetParty(Proto.General.Empty request, Grpc.Core.ServerCallContext context) diff --git a/Aurora/Services/Server/ServerService.cs b/Aurora/Services/Server/ServerService.cs index d1fcfcf..4cc8e37 100644 --- a/Aurora/Services/Server/ServerService.cs +++ b/Aurora/Services/Server/ServerService.cs @@ -11,7 +11,7 @@ namespace Aurora.Services.Server { public class ServerService : BaseService { - private int _port = SettingsService.Instance.DefaultPort; + private int _port = 8080; private string _hostname; private Grpc.Core.Server _server; diff --git a/aurora.code-workspace b/aurora.code-workspace index c4facab..e01f5db 100644 --- a/aurora.code-workspace +++ b/aurora.code-workspace @@ -9,6 +9,9 @@ "**/bin": true, "**/obj": true, "**/packages": true - } + }, + "nxunitExplorer.nunit": "/Users/brandonwatson/Documents/Gitlab/Aurora/aurora-sharp-desktop/Aurora.test/bin/Debug/nunit.framework.dll", + "nxunitExplorer.logpanel": true, + "dotnet-test-explorer.testProjectPath": "./Aurora.test" } } \ No newline at end of file