Fix authentication (mostly) and file upload tests failing

This commit is contained in:
jvyden 2021-12-20 01:05:23 -05:00
parent 8289e6c04e
commit 0d682dceeb
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
5 changed files with 25 additions and 13 deletions

View file

@ -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);
}
}