mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-15 06:02:28 +00:00
Fix Authentication tests
This commit is contained in:
parent
6db77a513f
commit
955b9e8060
2 changed files with 4 additions and 2 deletions
|
@ -3,6 +3,7 @@ using System.IO;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
using LBPUnion.ProjectLighthouse.Helpers;
|
||||||
using LBPUnion.ProjectLighthouse.Serialization;
|
using LBPUnion.ProjectLighthouse.Serialization;
|
||||||
using LBPUnion.ProjectLighthouse.Types;
|
using LBPUnion.ProjectLighthouse.Types;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
@ -29,7 +30,8 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
||||||
|
|
||||||
string stringContent = $"{LoginData.UsernamePrefix}{username}{number}{(char)0x00}";
|
string stringContent = $"{LoginData.UsernamePrefix}{username}{number}{(char)0x00}";
|
||||||
|
|
||||||
HttpResponseMessage response = await this.Client.PostAsync("/LITTLEBIGPLANETPS3_XML/login", new StringContent(stringContent));
|
HttpResponseMessage response = await this.Client.PostAsync
|
||||||
|
($"/LITTLEBIGPLANETPS3_XML/login?titleID={GameVersionHelper.LittleBigPlanet2TitleIds[0]}", new StringContent(stringContent));
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public async Task ShouldReturnErrorOnNoPostData()
|
public async Task ShouldReturnErrorOnNoPostData()
|
||||||
{
|
{
|
||||||
HttpResponseMessage response = await this.Client.PostAsync("/LITTLEBIGPLANETPS3_XML/login", null!);
|
HttpResponseMessage response = await this.Client.PostAsync($"/LITTLEBIGPLANETPS3_XML/login", null!);
|
||||||
Assert.False(response.IsSuccessStatusCode);
|
Assert.False(response.IsSuccessStatusCode);
|
||||||
#if NET6_0_OR_GREATER
|
#if NET6_0_OR_GREATER
|
||||||
Assert.True(response.StatusCode == HttpStatusCode.BadRequest);
|
Assert.True(response.StatusCode == HttpStatusCode.BadRequest);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue