Skip to content

Commit

Permalink
Updated and added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
HenningNormann committed Feb 21, 2025
1 parent 316ca31 commit 53a4921
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions test/UnitTest/HelperTests/InstanceEventHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public void RemoveDuplicateEvents_GivenListWithOneEvent_ReturnsListWithSameEvent
}

[Fact]
public void RemoveDuplicateEvents_GivenListWithTwoEqualEvents_ReturnsListWithSingleEvent()
public void RemoveDuplicateEvents_GivenListWithTwoEqualSavedEvents_ReturnsListWithSingleEvent()
{
// Arrange
List<InstanceEvent> instanceEvents = new List<InstanceEvent>
{
new InstanceEvent(),
new InstanceEvent()
new InstanceEvent() { EventType = InstanceEventType.Saved.ToString() },
new InstanceEvent() { EventType = InstanceEventType.Saved.ToString() }
};

// Act
Expand All @@ -60,6 +60,24 @@ public void RemoveDuplicateEvents_GivenListWithTwoEqualEvents_ReturnsListWithSin
Assert.Single(actual);
}

[Fact]
public void RemoveDuplicateEvents_GivenListWithTwoEqualNotificationSentSmsEvents_ReturnsListWithTwoEvent()
{
// Arrange
List<InstanceEvent> instanceEvents = new List<InstanceEvent>
{
new InstanceEvent() { EventType = InstanceEventType.NotificationSentSms.ToString() },
new InstanceEvent() { EventType = InstanceEventType.NotificationSentSms.ToString() }
};

// Act
List<InstanceEvent> actual = InstanceEventHelper.RemoveDuplicateEvents(instanceEvents);

// Assert
Assert.NotNull(actual);
Assert.True(actual.Count == instanceEvents.Count);
}

[Fact]
public void RemoveDuplicateEvents_GivenListWithTwoUniqueEventsOnEventType_ReturnsListWithoutCreatedEvent()
{
Expand Down

0 comments on commit 53a4921

Please sign in to comment.