Skip to content

Commit

Permalink
PM-10563: Extracting to const
Browse files Browse the repository at this point in the history
  • Loading branch information
mzieniukbw committed Oct 18, 2024
1 parent c426b4d commit 5548171
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public class NotificationsControllerTests : IClassFixture<ApiApplicationFactory>
private static readonly string _mockEncryptedTitle =
"2.06CDSJjTZaigYHUuswIq5A==|trxgZl2RCkYrrmCvGE9WNA==|w5p05eI5wsaYeSyWtsAPvBX63vj798kIMxBTfSB0BQg=";

private static readonly Random _random = new Random();
private static readonly Random _random = new();

private static TimeSpan OneMinuteTimeSpan => TimeSpan.FromMinutes(1);

private readonly HttpClient _client;
private readonly ApiApplicationFactory _factory;
Expand Down Expand Up @@ -301,7 +303,7 @@ private async void MarkAsDeletedAsync_NotificationStatusNotExisting_Created()
notifications[0].Id, _organizationUserOwner.UserId!.Value);
Assert.NotNull(notificationStatus);
Assert.NotNull(notificationStatus.DeletedDate);
Assert.Equal(DateTime.UtcNow, notificationStatus.DeletedDate.Value, TimeSpan.FromMinutes(1));
Assert.Equal(DateTime.UtcNow, notificationStatus.DeletedDate.Value, OneMinuteTimeSpan);
Assert.Null(notificationStatus.ReadDate);
}

Expand Down Expand Up @@ -329,7 +331,7 @@ await _notificationStatusRepository.CreateAsync(new NotificationStatus
notifications[0].Id, _organizationUserOwner.UserId!.Value);
Assert.NotNull(notificationStatus);
Assert.NotNull(notificationStatus.DeletedDate);
Assert.Equal(DateTime.UtcNow, notificationStatus.DeletedDate.Value, TimeSpan.FromMinutes(1));
Assert.Equal(DateTime.UtcNow, notificationStatus.DeletedDate.Value, OneMinuteTimeSpan);
Assert.Null(notificationStatus.ReadDate);
}

Expand Down Expand Up @@ -415,7 +417,7 @@ private async void MarkAsReadAsync_NotificationStatusNotExisting_Created()
notifications[0].Id, _organizationUserOwner.UserId!.Value);
Assert.NotNull(notificationStatus);
Assert.NotNull(notificationStatus.ReadDate);
Assert.Equal(DateTime.UtcNow, notificationStatus.ReadDate.Value, TimeSpan.FromMinutes(1));
Assert.Equal(DateTime.UtcNow, notificationStatus.ReadDate.Value, OneMinuteTimeSpan);
Assert.Null(notificationStatus.DeletedDate);
}

Expand Down Expand Up @@ -443,7 +445,7 @@ await _notificationStatusRepository.CreateAsync(new NotificationStatus
notifications[0].Id, _organizationUserOwner.UserId!.Value);
Assert.NotNull(notificationStatus);
Assert.NotNull(notificationStatus.ReadDate);
Assert.Equal(DateTime.UtcNow, notificationStatus.ReadDate.Value, TimeSpan.FromMinutes(1));
Assert.Equal(DateTime.UtcNow, notificationStatus.ReadDate.Value, OneMinuteTimeSpan);
Assert.Null(notificationStatus.DeletedDate);
}

Expand Down

0 comments on commit 5548171

Please sign in to comment.