public async Task TestForGetUnreadNotificationCount() { Mock <INotificationManager> manager = new Mock <INotificationManager>(); manager.Setup(x => x.GetUnreadNotificationCount("hverma")).Returns(Task.FromResult(5)); NotificationServices service = new NotificationServices(manager.Object); var expectedCount = service.GetUnreadNotificationCount("hverma").GetAwaiter().GetResult(); Assert.AreEqual(expectedCount, 5); }