-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VIH-10362 Fix issue with judge display name not auto populating for e…
…jud and V1 API (#1317) * Fix issue with judge display name not auto populating * Add tests for mapper
- Loading branch information
1 parent
d93b208
commit ed89c32
Showing
4 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
using AdminWebsite.Contracts.Responses; | ||
using AdminWebsite.Contracts.Enums; | ||
using AdminWebsite.Contracts.Responses; | ||
using AdminWebsite.Mappers; | ||
using BookingsApi.Contract.V1.Responses; | ||
using FluentAssertions; | ||
|
@@ -26,5 +27,29 @@ public void Should_map_person_response_to_judge_response() | |
judgeResponse.Email.Should().Be(personResponse.Email); | ||
judgeResponse.ContactEmail.Should().Be(personResponse.ContactEmail); | ||
} | ||
|
||
[Test] | ||
public void Should_map_judiciary_person_response_to_judge_response() | ||
{ | ||
var judiciaryPersonResponse = new JudiciaryPersonResponse | ||
{ | ||
Title = "Mr", | ||
FirstName = "FirstName", | ||
LastName = "LastName", | ||
FullName = "FirstName LastName", | ||
Email = "[email protected]", | ||
WorkPhone = "123", | ||
PersonalCode = "PersonalCode" | ||
}; | ||
|
||
var judgeResponse = JudgeResponseMapper.MapTo(judiciaryPersonResponse); | ||
|
||
judgeResponse.FirstName.Should().Be(judiciaryPersonResponse.FirstName); | ||
judgeResponse.LastName.Should().Be(judiciaryPersonResponse.LastName); | ||
judgeResponse.DisplayName.Should().Be(judiciaryPersonResponse.FullName); | ||
judgeResponse.Email.Should().Be(judiciaryPersonResponse.Email); | ||
judgeResponse.ContactEmail.Should().Be(judiciaryPersonResponse.Email); | ||
judgeResponse.AccountType.Should().Be(JudgeAccountType.Judiciary); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters