public async Task TestForGetAllNotifications() { List <Notification> listOfNotifications = new List <Notification>(); Mock <INotificationManager> manager = new Mock <INotificationManager>(); manager.Setup(mock => mock.GetNotificationsAsync("hverma")).Returns(Task.FromResult(listOfNotifications)); NotificationServices services = new NotificationServices(manager.Object); var expectedOutput = await services.GetNotificationsAsync("hverma"); CollectionAssert.AreEqual(listOfNotifications, expectedOutput); }