mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-17 07:12:32 +00:00
Remove PL.Tests dependency on all server projects
Should allow slightly faster parallelized builds.
This commit is contained in:
parent
5420583021
commit
e72e924c40
9 changed files with 14 additions and 12 deletions
|
@ -27,6 +27,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ProjectLighthouse.Servers.GameServer\ProjectLighthouse.Servers.GameServer.csproj" />
|
||||||
<ProjectReference Include="..\ProjectLighthouse.Tests\ProjectLighthouse.Tests.csproj" />
|
<ProjectReference Include="..\ProjectLighthouse.Tests\ProjectLighthouse.Tests.csproj" />
|
||||||
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
|
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -4,12 +4,13 @@ using System.Threading.Tasks;
|
||||||
using LBPUnion.ProjectLighthouse.Configuration;
|
using LBPUnion.ProjectLighthouse.Configuration;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers;
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||||
|
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
||||||
using LBPUnion.ProjectLighthouse.Tests;
|
using LBPUnion.ProjectLighthouse.Tests;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
||||||
|
|
||||||
public class AuthenticationTests : LighthouseServerTest
|
public class AuthenticationTests : LighthouseServerTest<GameServerTestStartup>
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task ShouldReturnErrorOnNoPostData()
|
public async Task ShouldReturnErrorOnNoPostData()
|
||||||
|
|
|
@ -3,12 +3,13 @@ using System.Threading.Tasks;
|
||||||
using LBPUnion.ProjectLighthouse;
|
using LBPUnion.ProjectLighthouse;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers;
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||||
|
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
||||||
using LBPUnion.ProjectLighthouse.Tests;
|
using LBPUnion.ProjectLighthouse.Tests;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
||||||
|
|
||||||
public class DatabaseTests : LighthouseServerTest
|
public class DatabaseTests : LighthouseServerTest<GameServerTestStartup>
|
||||||
{
|
{
|
||||||
[DatabaseFact]
|
[DatabaseFact]
|
||||||
public async Task CanCreateUserTwice()
|
public async Task CanCreateUserTwice()
|
||||||
|
|
|
@ -5,12 +5,13 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers;
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||||
|
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
||||||
using LBPUnion.ProjectLighthouse.Tests;
|
using LBPUnion.ProjectLighthouse.Tests;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
||||||
|
|
||||||
public class MatchTests : LighthouseServerTest
|
public class MatchTests : LighthouseServerTest<GameServerTestStartup>
|
||||||
{
|
{
|
||||||
private static readonly SemaphoreSlim semaphore = new(1, 1);
|
private static readonly SemaphoreSlim semaphore = new(1, 1);
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,13 @@ using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.Levels;
|
using LBPUnion.ProjectLighthouse.Levels;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
using LBPUnion.ProjectLighthouse.PlayerData.Profiles;
|
||||||
|
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
||||||
using LBPUnion.ProjectLighthouse.Tests;
|
using LBPUnion.ProjectLighthouse.Tests;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
||||||
|
|
||||||
public class SlotTests : LighthouseServerTest
|
public class SlotTests : LighthouseServerTest<GameServerTestStartup>
|
||||||
{
|
{
|
||||||
[DatabaseFact]
|
[DatabaseFact]
|
||||||
public async Task ShouldOnlyShowUsersLevels()
|
public async Task ShouldOnlyShowUsersLevels()
|
||||||
|
|
|
@ -4,12 +4,13 @@ using System.Net;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||||
|
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
||||||
using LBPUnion.ProjectLighthouse.Tests;
|
using LBPUnion.ProjectLighthouse.Tests;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
namespace ProjectLighthouse.Tests.GameApiTests.Tests;
|
||||||
|
|
||||||
public class UploadTests : LighthouseServerTest
|
public class UploadTests : LighthouseServerTest<GameServerTestStartup>
|
||||||
{
|
{
|
||||||
public UploadTests()
|
public UploadTests()
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\ProjectLighthouse.Servers.Website\ProjectLighthouse.Servers.Website.csproj" />
|
||||||
<ProjectReference Include="..\ProjectLighthouse.Tests\ProjectLighthouse.Tests.csproj" />
|
<ProjectReference Include="..\ProjectLighthouse.Tests\ProjectLighthouse.Tests.csproj" />
|
||||||
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
|
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -7,8 +7,6 @@ using System.Xml.Serialization;
|
||||||
using LBPUnion.ProjectLighthouse.Helpers;
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.PlayerData;
|
using LBPUnion.ProjectLighthouse.PlayerData;
|
||||||
using LBPUnion.ProjectLighthouse.Serialization;
|
using LBPUnion.ProjectLighthouse.Serialization;
|
||||||
using LBPUnion.ProjectLighthouse.Servers.GameServer.Startup;
|
|
||||||
using LBPUnion.ProjectLighthouse.Types;
|
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.TestHost;
|
using Microsoft.AspNetCore.TestHost;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
@ -16,14 +14,14 @@ using Microsoft.EntityFrameworkCore;
|
||||||
namespace LBPUnion.ProjectLighthouse.Tests;
|
namespace LBPUnion.ProjectLighthouse.Tests;
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||||
public class LighthouseServerTest
|
public class LighthouseServerTest<TStartup> where TStartup : class
|
||||||
{
|
{
|
||||||
public readonly HttpClient Client;
|
public readonly HttpClient Client;
|
||||||
public readonly TestServer Server;
|
public readonly TestServer Server;
|
||||||
|
|
||||||
public LighthouseServerTest()
|
public LighthouseServerTest()
|
||||||
{
|
{
|
||||||
this.Server = new TestServer(new WebHostBuilder().UseStartup<GameServerTestStartup>());
|
this.Server = new TestServer(new WebHostBuilder().UseStartup<TStartup>());
|
||||||
this.Client = this.Server.CreateClient();
|
this.Client = this.Server.CreateClient();
|
||||||
}
|
}
|
||||||
public async Task<HttpResponseMessage> AuthenticateResponse(int number = -1, bool createUser = true)
|
public async Task<HttpResponseMessage> AuthenticateResponse(int number = -1, bool createUser = true)
|
||||||
|
|
|
@ -35,9 +35,6 @@
|
||||||
<Content Include="ExampleFiles\**">
|
<Content Include="ExampleFiles\**">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<ProjectReference Include="..\ProjectLighthouse.Servers.API\ProjectLighthouse.Servers.API.csproj" />
|
|
||||||
<ProjectReference Include="..\ProjectLighthouse.Servers.GameServer\ProjectLighthouse.Servers.GameServer.csproj" />
|
|
||||||
<ProjectReference Include="..\ProjectLighthouse.Servers.Website\ProjectLighthouse.Servers.Website.csproj" />
|
|
||||||
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
|
<ProjectReference Include="..\ProjectLighthouse\ProjectLighthouse.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue