Skip to content

Commit

Permalink
Tries to fix a encoding problem in Assert comparer where strings in s…
Browse files Browse the repository at this point in the history
…ource code is encoded wrong on build server but correct on dev machine.
  • Loading branch information
lovoll committed Feb 1, 2024
1 parent e7c45f6 commit 9c9545a
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,17 @@ public async Task GetUserListByUuid_SblBridgeFindsProfile_ResponseOk_ReturnsUser
// Arrange
List<Guid> userUuids = new List<Guid> { new("cc86d2c7-1695-44b0-8e82-e633243fdf31"), new("4c3b4909-eb17-45d5-bde1-256e065e196a") };

List<UserProfile> userProfiles = new()
{
await TestDataLoader.Load<UserProfile>(userUuids[0].ToString()),
await TestDataLoader.Load<UserProfile>(userUuids[1].ToString())
};

HttpRequestMessage sblRequest = null;
DelegatingHandlerStub messageHandler = new(async (request, token) =>
DelegatingHandlerStub messageHandler = new((request, token) =>
{
sblRequest = request;
List<UserProfile> userProfiles = new List<UserProfile>();
userProfiles.Add(await TestDataLoader.Load<UserProfile>(userUuids[0].ToString()));
userProfiles.Add(await TestDataLoader.Load<UserProfile>(userUuids[1].ToString()));
return new HttpResponseMessage() { Content = JsonContent.Create(userProfiles) };
return Task.FromResult(new HttpResponseMessage() { Content = JsonContent.Create(userProfiles) });
});
_webApplicationFactorySetup.SblBridgeHttpMessageHandler = messageHandler;

Expand All @@ -155,14 +156,14 @@ public async Task GetUserListByUuid_SblBridgeFindsProfile_ResponseOk_ReturnsUser

// These asserts check that deserializing with camel casing was successful.
Assert.Equal(userUuids[0], actualUsers[0].UserUuid);
Assert.Equal("LEO WILHELMSEN", actualUsers[0].Party.Name);
Assert.Equal("LEO", actualUsers[0].Party.Person.FirstName);
Assert.Equal("nb", actualUsers[0].ProfileSettingPreference.Language);
Assert.Equal(userProfiles[0].Party.Name, actualUsers[0].Party.Name);
Assert.Equal(userProfiles[0].Party.Person.FirstName, actualUsers[0].Party.Person.FirstName);
Assert.Equal(userProfiles[0].ProfileSettingPreference.Language, actualUsers[0].ProfileSettingPreference.Language);

Assert.Equal(userUuids[1], actualUsers[1].UserUuid);
Assert.Equal("ELENA FJÆR", actualUsers[1].Party.Name);
Assert.Equal("ELENA", actualUsers[1].Party.Person.FirstName);
Assert.Equal("nn", actualUsers[1].ProfileSettingPreference.Language);
Assert.Equal(userProfiles[1].Party.Name, actualUsers[1].Party.Name);
Assert.Equal(userProfiles[1].Party.Person.FirstName, actualUsers[1].Party.Person.FirstName);
Assert.Equal(userProfiles[1].ProfileSettingPreference.Language, actualUsers[1].ProfileSettingPreference.Language);
}

[Fact]
Expand Down

0 comments on commit 9c9545a

Please sign in to comment.