mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-30 22:29:01 +00:00
Fix all tests
This commit is contained in:
parent
688721d6c2
commit
84669201ab
5 changed files with 25 additions and 7 deletions
|
@ -49,10 +49,10 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
{
|
||||
LoginResult loginResult = await this.Authenticate();
|
||||
|
||||
HttpResponseMessage response = await this.AuthenticatedRequest("/LITTLEBIGPLANETPS3_XML/announce", loginResult.AuthTicket);
|
||||
HttpResponseMessage response = await this.AuthenticatedRequest("/LITTLEBIGPLANETPS3_XML/enterLevel/1", loginResult.AuthTicket);
|
||||
string responseContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
Assert.True(response.IsSuccessStatusCode);
|
||||
Assert.False(response.StatusCode == HttpStatusCode.Forbidden);
|
||||
}
|
||||
|
||||
[DatabaseFact]
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Net.Http;
|
|||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using LBPUnion.ProjectLighthouse.Helpers;
|
||||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using Xunit;
|
||||
|
||||
|
@ -36,7 +37,6 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
semaphore.Release();
|
||||
Assert.True(result.IsSuccessStatusCode);
|
||||
}
|
||||
public async Task<int> GetPlayerCount() => Convert.ToInt32(await this.Client.GetStringAsync("LITTLEBIGPLANETPS3_XML/totalPlayerCount"));
|
||||
|
||||
[DatabaseFact]
|
||||
public async Task ShouldIncrementPlayerCount()
|
||||
|
@ -45,14 +45,14 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
|
||||
await semaphore.WaitAsync();
|
||||
|
||||
int oldPlayerCount = await this.GetPlayerCount();
|
||||
int oldPlayerCount = await StatisticsHelper.RecentMatches();
|
||||
|
||||
HttpResponseMessage result = await this.AuthenticatedUploadDataRequest
|
||||
("LITTLEBIGPLANETPS3_XML/match", Encoding.ASCII.GetBytes("[UpdateMyPlayerData,[\"Player\":\"1984\"]]"), loginResult.AuthTicket);
|
||||
|
||||
Assert.True(result.IsSuccessStatusCode);
|
||||
|
||||
int playerCount = await this.GetPlayerCount();
|
||||
int playerCount = await StatisticsHelper.RecentMatches();
|
||||
|
||||
semaphore.Release();
|
||||
Assert.Equal(oldPlayerCount + 1, playerCount);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue