diff options
author | crupest <crupest@outlook.com> | 2020-01-31 15:21:58 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-01-31 15:21:58 +0800 |
commit | 0dc8b59b435f978428c73bc28e2a424bc413c562 (patch) | |
tree | bbbac2fe1a6d3ce4c5d2c32553f6d06cb3209172 /Timeline.Tests/IntegratedTests/IntegratedTestBase.cs | |
parent | eaf6d126db56b7caedd311033403b1f721bb80bc (diff) | |
download | timeline-0dc8b59b435f978428c73bc28e2a424bc413c562.tar.gz timeline-0dc8b59b435f978428c73bc28e2a424bc413c562.tar.bz2 timeline-0dc8b59b435f978428c73bc28e2a424bc413c562.zip |
Combine two user info types.
Diffstat (limited to 'Timeline.Tests/IntegratedTests/IntegratedTestBase.cs')
-rw-r--r-- | Timeline.Tests/IntegratedTests/IntegratedTestBase.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs b/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs index 242e96cd..59af5eab 100644 --- a/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs +++ b/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs @@ -15,6 +15,12 @@ namespace Timeline.Tests.IntegratedTests public abstract class IntegratedTestBase : IClassFixture<WebApplicationFactory<Startup>>, IDisposable { + static IntegratedTestBase()
+ {
+ FluentAssertions.AssertionOptions.AssertEquivalencyUsing(options =>
+ options.Excluding(m => m.RuntimeType == typeof(UserInfo) && m.SelectedMemberPath == "_links"));
+ } + protected TestApplication TestApp { get; } protected WebApplicationFactory<Startup> Factory => TestApp.Factory; @@ -56,7 +62,6 @@ namespace Timeline.Tests.IntegratedTests }
var userInfoList = new List<UserInfo>();
- var userInfoForAdminList = new List<UserInfoForAdmin>();
var userService = scope.ServiceProvider.GetRequiredService<IUserService>();
var mapper = scope.ServiceProvider.GetRequiredService<IMapper>();
@@ -65,11 +70,9 @@ namespace Timeline.Tests.IntegratedTests {
userService.CreateUser(user).Wait();
userInfoList.Add(mapper.Map<UserInfo>(user));
- userInfoForAdminList.Add(mapper.Map<UserInfoForAdmin>(user));
}
- UserInfoList = userInfoList;
- UserInfoForAdminList = userInfoForAdminList;
+ UserInfos = userInfoList;
}
} @@ -83,9 +86,7 @@ namespace Timeline.Tests.IntegratedTests TestApp.Dispose(); } - public IReadOnlyList<UserInfo> UserInfoList { get; } - - public IReadOnlyList<UserInfoForAdmin> UserInfoForAdminList { get; } + public IReadOnlyList<UserInfo> UserInfos { get; } public Task<HttpClient> CreateDefaultClient() { |