-
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.
- Loading branch information
1 parent
42e2050
commit 66e1a4e
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
35 changes: 30 additions & 5 deletions
35
AdminWebsite/AdminWebsite.UnitTests/Extensions/HearingDetailsResponseExtensionsTests.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 |
---|---|---|
@@ -1,18 +1,43 @@ | ||
using AdminWebsite.Contracts.Responses; | ||
using AdminWebsite.Extensions; | ||
|
||
namespace AdminWebsite.UnitTests.Extensions | ||
{ | ||
public class HearingDetailsResponseExtensionsTests | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
[Test] | ||
public void HasScheduleAmended__True_WhenDatesHaveChanged() | ||
{ | ||
new HearingDetailsResponse | ||
var hearing = new HearingDetailsResponse | ||
{ | ||
Id = Guid.NewGuid(), | ||
Participants = new List<ParticipantResponse>() | ||
ScheduledDateTime = DateTime.UtcNow | ||
}; | ||
var anotherHearing = new HearingDetailsResponse | ||
{ | ||
ScheduledDateTime = DateTime.UtcNow.AddHours(1) | ||
}; | ||
|
||
var result = hearing.HasScheduleAmended(anotherHearing); | ||
|
||
result.Should().BeTrue(); | ||
} | ||
|
||
[Test] | ||
public void HasScheduleAmended__False_WhenDatesAreTheSame() | ||
{ | ||
var now = DateTime.UtcNow; | ||
var hearing = new HearingDetailsResponse | ||
{ | ||
ScheduledDateTime = now | ||
}; | ||
var anotherHearing = new HearingDetailsResponse | ||
{ | ||
ScheduledDateTime = now | ||
}; | ||
|
||
var result = hearing.HasScheduleAmended(anotherHearing); | ||
|
||
result.Should().BeFalse(); | ||
} | ||
} | ||
} |
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