mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-28 11:42:28 +00:00
Fix authentication (mostly) and file upload tests failing
This commit is contained in:
parent
8289e6c04e
commit
0d682dceeb
5 changed files with 25 additions and 13 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
@ -18,6 +19,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
public async Task ShouldNotAcceptScript()
|
||||
{
|
||||
HttpResponseMessage response = await this.UploadFileEndpointRequest("ExampleFiles/TestScript.ff");
|
||||
Assert.False(response.StatusCode == HttpStatusCode.Forbidden);
|
||||
Assert.False(response.IsSuccessStatusCode);
|
||||
}
|
||||
|
||||
|
@ -25,6 +27,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
public async Task ShouldNotAcceptFarc()
|
||||
{
|
||||
HttpResponseMessage response = await this.UploadFileEndpointRequest("ExampleFiles/TestFarc.farc");
|
||||
Assert.False(response.StatusCode == HttpStatusCode.Forbidden);
|
||||
Assert.False(response.IsSuccessStatusCode);
|
||||
}
|
||||
|
||||
|
@ -32,6 +35,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
public async Task ShouldNotAcceptGarbage()
|
||||
{
|
||||
HttpResponseMessage response = await this.UploadFileEndpointRequest("ExampleFiles/TestGarbage.bin");
|
||||
Assert.False(response.StatusCode == HttpStatusCode.Forbidden);
|
||||
Assert.False(response.IsSuccessStatusCode);
|
||||
}
|
||||
|
||||
|
@ -39,6 +43,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
public async Task ShouldAcceptTexture()
|
||||
{
|
||||
HttpResponseMessage response = await this.UploadFileEndpointRequest("ExampleFiles/TestTexture.tex");
|
||||
Assert.False(response.StatusCode == HttpStatusCode.Forbidden);
|
||||
Assert.True(response.IsSuccessStatusCode);
|
||||
}
|
||||
|
||||
|
@ -46,6 +51,7 @@ namespace LBPUnion.ProjectLighthouse.Tests
|
|||
public async Task ShouldAcceptLevel()
|
||||
{
|
||||
HttpResponseMessage response = await this.UploadFileEndpointRequest("ExampleFiles/TestLevel.lvl");
|
||||
Assert.False(response.StatusCode == HttpStatusCode.Forbidden);
|
||||
Assert.True(response.IsSuccessStatusCode);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue