From 45a6ca3a189a81060ae44d0764248547fe2b686c Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 31 Jan 2020 15:21:58 +0800 Subject: Combine two user info types. --- Timeline.Tests/IntegratedTests/IntegratedTestBase.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Timeline.Tests/IntegratedTests/IntegratedTestBase.cs') 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>, IDisposable { + static IntegratedTestBase() + { + FluentAssertions.AssertionOptions.AssertEquivalencyUsing(options => + options.Excluding(m => m.RuntimeType == typeof(UserInfo) && m.SelectedMemberPath == "_links")); + } + protected TestApplication TestApp { get; } protected WebApplicationFactory Factory => TestApp.Factory; @@ -56,7 +62,6 @@ namespace Timeline.Tests.IntegratedTests } var userInfoList = new List(); - var userInfoForAdminList = new List(); var userService = scope.ServiceProvider.GetRequiredService(); var mapper = scope.ServiceProvider.GetRequiredService(); @@ -65,11 +70,9 @@ namespace Timeline.Tests.IntegratedTests { userService.CreateUser(user).Wait(); userInfoList.Add(mapper.Map(user)); - userInfoForAdminList.Add(mapper.Map(user)); } - UserInfoList = userInfoList; - UserInfoForAdminList = userInfoForAdminList; + UserInfos = userInfoList; } } @@ -83,9 +86,7 @@ namespace Timeline.Tests.IntegratedTests TestApp.Dispose(); } - public IReadOnlyList UserInfoList { get; } - - public IReadOnlyList UserInfoForAdminList { get; } + public IReadOnlyList UserInfos { get; } public Task CreateDefaultClient() { -- cgit v1.2.3