22{
33 using System ;
44 using System . Collections . Generic ;
5- using DigitalLearningSolutions . Data . DataServices ;
65 using DigitalLearningSolutions . Data . Models ;
76 using DigitalLearningSolutions . Data . Utilities ;
87 using DigitalLearningSolutions . Web . Controllers . TrackingSystem . Centre ;
@@ -23,18 +22,18 @@ public class SystemNotificationControllerTests
2322 private HttpRequest httpRequest = null ! ;
2423 private HttpResponse httpResponse = null ! ;
2524 private ISearchSortFilterPaginateService searchSortFilterPaginateService = null ! ;
26- private ISystemNotificationsDataService systemNotificationsDataService = null ! ;
25+ private ISystemNotificationsService systemNotificationsService = null ! ;
2726
2827 [ SetUp ]
2928 public void Setup ( )
3029 {
3130 httpRequest = A . Fake < HttpRequest > ( ) ;
3231 httpResponse = A . Fake < HttpResponse > ( ) ;
33- systemNotificationsDataService = A . Fake < ISystemNotificationsDataService > ( ) ;
32+ systemNotificationsService = A . Fake < ISystemNotificationsService > ( ) ;
3433 searchSortFilterPaginateService = A . Fake < ISearchSortFilterPaginateService > ( ) ;
3534 controller =
3635 new SystemNotificationsController (
37- systemNotificationsDataService ,
36+ systemNotificationsService ,
3837 clockUtility ,
3938 searchSortFilterPaginateService
4039 )
@@ -51,7 +50,7 @@ public void Index_sets_cookie_when_unacknowledged_notifications_exist()
5150 var testDate = new DateTime ( 2021 , 8 , 23 ) ;
5251 A . CallTo ( ( ) => clockUtility . UtcNow ) . Returns ( testDate ) ;
5352 var expectedExpiry = testDate . AddHours ( 24 ) ;
54- A . CallTo ( ( ) => systemNotificationsDataService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
53+ A . CallTo ( ( ) => systemNotificationsService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
5554 . Returns ( new List < SystemNotification > { SystemNotificationTestHelper . GetDefaultSystemNotification ( ) } ) ;
5655
5756 // When
@@ -80,7 +79,7 @@ public void Post_acknowledges_notification_and_redirects()
8079 // Then
8180 using ( new AssertionScope ( ) )
8281 {
83- A . CallTo ( ( ) => systemNotificationsDataService . AcknowledgeNotification ( 1 , 7 ) ) . MustHaveHappened ( ) ;
82+ A . CallTo ( ( ) => systemNotificationsService . AcknowledgeNotification ( 1 , 7 ) ) . MustHaveHappened ( ) ;
8483 result . Should ( ) . BeRedirectToActionResult ( ) . WithControllerName ( "SystemNotifications" )
8584 . WithActionName ( "Index" ) ;
8685 }
@@ -93,7 +92,7 @@ public void Index_deletes_cookie_if_one_exists_for_user_and_no_unacknowledged_no
9392 A . CallTo ( ( ) => httpRequest . Cookies ) . Returns (
9493 ControllerContextHelper . SetUpFakeRequestCookieCollection ( SystemNotificationCookieHelper . CookieName , "7" )
9594 ) ;
96- A . CallTo ( ( ) => systemNotificationsDataService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
95+ A . CallTo ( ( ) => systemNotificationsService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
9796 . Returns ( new List < SystemNotification > ( ) ) ;
9897
9998 // When
@@ -110,7 +109,7 @@ public void Index_does_not_delete_cookie_if_one_exists_for_someone_other_than_cu
110109 A . CallTo ( ( ) => httpRequest . Cookies ) . Returns (
111110 ControllerContextHelper . SetUpFakeRequestCookieCollection ( SystemNotificationCookieHelper . CookieName , "8" )
112111 ) ;
113- A . CallTo ( ( ) => systemNotificationsDataService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
112+ A . CallTo ( ( ) => systemNotificationsService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
114113 . Returns ( new List < SystemNotification > ( ) ) ;
115114
116115 // When
@@ -128,7 +127,7 @@ public void Index_does_not_delete_cookie_if_one_does_not_exist()
128127 A . CallTo ( ( ) => httpRequest . Cookies ) . Returns (
129128 A . Fake < IRequestCookieCollection > ( )
130129 ) ;
131- A . CallTo ( ( ) => systemNotificationsDataService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
130+ A . CallTo ( ( ) => systemNotificationsService . GetUnacknowledgedSystemNotifications ( A < int > . _ ) )
132131 . Returns ( new List < SystemNotification > ( ) ) ;
133132
134133 // When
0 commit comments