aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-15 00:05:02 +0800
committercrupest <crupest@outlook.com>2020-06-15 00:05:02 +0800
commite0b4c538228864c314900affae08df72edc9cd60 (patch)
treefc07d6d2622140f82a2c7e3c50aecf759c144043 /Timeline.Tests/IntegratedTests/UserAvatarTest.cs
parentcf2cfa4853944ce0af6b6c22a089b937dd59ccaf (diff)
downloadtimeline-e0b4c538228864c314900affae08df72edc9cd60.tar.gz
timeline-e0b4c538228864c314900affae08df72edc9cd60.tar.bz2
timeline-e0b4c538228864c314900affae08df72edc9cd60.zip
refactor(back): Use generic host.
Diffstat (limited to 'Timeline.Tests/IntegratedTests/UserAvatarTest.cs')
-rw-r--r--Timeline.Tests/IntegratedTests/UserAvatarTest.cs9
1 files changed, 1 insertions, 8 deletions
diff --git a/Timeline.Tests/IntegratedTests/UserAvatarTest.cs b/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
index fbf34490..91986cda 100644
--- a/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
+++ b/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
@@ -1,6 +1,5 @@
using FluentAssertions;
using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.Extensions.DependencyInjection;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Gif;
@@ -21,12 +20,6 @@ namespace Timeline.Tests.IntegratedTests
{
public class UserAvatarTest : IntegratedTestBase
{
- public UserAvatarTest(WebApplicationFactory<Startup> factory)
- : base(factory)
- {
-
- }
-
[Fact]
public async Task Test()
{
@@ -45,7 +38,7 @@ namespace Timeline.Tests.IntegratedTests
.Which.Code.Should().Be(ErrorCodes.UserCommon.NotExist);
}
- var env = Factory.Server.Host.Services.GetRequiredService<IWebHostEnvironment>();
+ var env = TestApp.Host.Services.GetRequiredService<IWebHostEnvironment>();
var defaultAvatarData = await File.ReadAllBytesAsync(Path.Combine(env.ContentRootPath, "default-avatar.png"));
async Task GetReturnDefault(string username = "user1")