mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-05-14 05:42:27 +00:00
Add tests for match
This commit is contained in:
parent
a459ef2302
commit
15e3870620
2 changed files with 60 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
using System.IO;
|
||||
using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
|
@ -52,10 +53,22 @@ namespace ProjectLighthouse.Tests {
|
|||
return await this.Client.PostAsync(endpoint, new StringContent(await File.ReadAllTextAsync(filePath)));
|
||||
}
|
||||
|
||||
public async Task<HttpResponseMessage> AuthenticatedUploadFileRequest(string endpoint, string filePath) {
|
||||
public async Task<HttpResponseMessage> UploadDataRequest(string endpoint, byte[] data) {
|
||||
return await this.Client.PostAsync(endpoint, new ByteArrayContent(data));
|
||||
}
|
||||
|
||||
public async Task<HttpResponseMessage> AuthenticatedUploadFileRequest(string endpoint, string filePath, string mmAuth) {
|
||||
using var requestMessage = new HttpRequestMessage(HttpMethod.Post, endpoint);
|
||||
requestMessage.Headers.Add("Cookie", mmAuth);
|
||||
requestMessage.Content = new StringContent(await File.ReadAllTextAsync(filePath));
|
||||
return await this.Client.SendAsync(requestMessage);
|
||||
}
|
||||
|
||||
public async Task<HttpResponseMessage> AuthenticatedUploadDataRequest(string endpoint, byte[] data, string mmAuth) {
|
||||
using var requestMessage = new HttpRequestMessage(HttpMethod.Post, endpoint);
|
||||
requestMessage.Headers.Add("Cookie", mmAuth);
|
||||
requestMessage.Content = new ByteArrayContent(data);
|
||||
return await this.Client.SendAsync(requestMessage);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue