|
|
|
@ -3,6 +3,7 @@ using System.Net.Http; |
|
|
|
using System.Net.Http.Headers; |
|
|
|
using System.Text; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Web; |
|
|
|
using Shouldly; |
|
|
|
using Xunit; |
|
|
|
|
|
|
|
@ -20,7 +21,7 @@ public class RemoteStreamContentTestController_Tests : AspNetCoreMvcTestBase |
|
|
|
(await result.Content.ReadAsStringAsync()).ShouldBe("DownloadAsync"); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
[Fact] |
|
|
|
public async Task Download_With_Custom_Content_Disposition_Async() |
|
|
|
{ |
|
|
|
var result = await GetResponseAsync("/api/remote-stream-content-test/download-with-custom-content-disposition"); |
|
|
|
@ -29,6 +30,16 @@ public class RemoteStreamContentTestController_Tests : AspNetCoreMvcTestBase |
|
|
|
result.Content.Headers.ContentLength.ShouldBe("DownloadAsync".Length); |
|
|
|
(await result.Content.ReadAsStringAsync()).ShouldBe("DownloadAsync"); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task Download_With_Chinese_File_Name_Async() |
|
|
|
{ |
|
|
|
var result = await GetResponseAsync("/api/remote-stream-content-test/download_with_chinese_file_name"); |
|
|
|
result.Content.Headers.ContentType?.ToString().ShouldBe("application/rtf"); |
|
|
|
result.Content.Headers.ContentDisposition?.FileNameStar.ShouldBe("下载文件.rtf"); |
|
|
|
result.Content.Headers.ContentLength.ShouldBe("DownloadAsync".Length); |
|
|
|
(await result.Content.ReadAsStringAsync()).ShouldBe("DownloadAsync"); |
|
|
|
} |
|
|
|
|
|
|
|
[Fact] |
|
|
|
public async Task UploadAsync() |
|
|
|
|