-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…149) * Update NotificationParameterMapper.cs * added test * Update MapToHearingAmendmentNotificationTests.cs * Update MapToHearingAmendmentNotificationTests.cs
- Loading branch information
1 parent
2c522ee
commit 38c6689
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...i.UnitTests/Mappers/NotificationParameterMapper/MapToHearingAmendmentNotificationTests.cs
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using FluentAssertions; | ||
using NotificationApi.Common; | ||
using NotificationApi.Contract.Requests; | ||
using NUnit.Framework; | ||
|
||
namespace NotificationApi.UnitTests.Mappers.NotificationParameterMapper | ||
{ | ||
public class MapToHearingAmendmentNotificationTests | ||
{ | ||
|
||
[Test] | ||
public void should_map_to_amendment_notification_for_individual() | ||
{ | ||
//Arrange | ||
var oldDate = new DateTime(2020, 2, 10, 11, 30, 0, DateTimeKind.Utc); | ||
var newDate = new DateTime(2020, 10, 12, 13, 10, 0, DateTimeKind.Utc); | ||
|
||
var request = new HearingAmendmentRequest | ||
{ | ||
HearingId = new Guid("73f2053e-74f1-4d6c-b817-246f4b22e666"), | ||
ContactEmail = "[email protected]", | ||
ParticipantId = new Guid("73f2053e-74f1-4d6c-b817-246f4b22e665"), | ||
CaseName = "Case name", | ||
PreviousScheduledDateTime = oldDate, | ||
NewScheduledDateTime = newDate, | ||
RoleName = "Individual", | ||
CaseNumber = "Original Hearing", | ||
Name = $"Automation_FirstName Automation_LastName", | ||
DisplayName = "Automation_FirstName Automation_LastName", | ||
Representee = "", | ||
Username = "[email protected]" | ||
}; | ||
|
||
//Act | ||
var result = NotificationApi.Services.NotificationParameterMapper.MapToHearingAmendment(request); | ||
|
||
//Assert | ||
result.Should().NotBeNull(); | ||
result[NotifyParams.CaseName].Should().Be("Case name"); | ||
result[NotifyParams.UserName].Should().Be("[email protected]"); | ||
result[NotifyParams.CaseNumber].Should().Be("Original Hearing"); | ||
result[NotifyParams.OldTime].Should().Be("11:30 AM"); | ||
result[NotifyParams.NewTime].Should().Be("2:10 PM"); | ||
result[NotifyParams.OldDayMonthYear].Should().Be("10 February 2020"); | ||
result[NotifyParams.NewDayMonthYear].Should().Be("12 October 2020"); | ||
result[NotifyParams.Name].Should().Be("Automation_FirstName Automation_LastName"); | ||
} | ||
} | ||
} |
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