aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-01-31 15:21:58 +0800
committercrupest <crupest@outlook.com>2020-01-31 15:21:58 +0800
commit45a6ca3a189a81060ae44d0764248547fe2b686c (patch)
treebbbac2fe1a6d3ce4c5d2c32553f6d06cb3209172 /Timeline.Tests/IntegratedTests/IntegratedTestBase.cs
parent038e8dcf461d4d4ebd51c8fdf7680497869f691c (diff)
downloadtimeline-45a6ca3a189a81060ae44d0764248547fe2b686c.tar.gz
timeline-45a6ca3a189a81060ae44d0764248547fe2b686c.tar.bz2
timeline-45a6ca3a189a81060ae44d0764248547fe2b686c.zip
Combine two user info types.
Diffstat (limited to 'Timeline.Tests/IntegratedTests/IntegratedTestBase.cs')
-rw-r--r--Timeline.Tests/IntegratedTests/IntegratedTestBase.cs15
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()
{