public async Task TestForSendNotificationToUser() { var objectTobeSentinBusinessLayer = new Notification() { Message = "Himani posted on your wall" }; var objectToBeSentinServiceLayer = new ServiceLayer.DataContract.Notification() { Message = "Himani posted on your wall" }; Mock <INotificationManager> manager = new Mock <INotificationManager>(); manager.Setup(mock => mock.PushNotificationsAsync(It.IsAny <Notification>())).Returns(Task.FromResult(objectTobeSentinBusinessLayer)); NotificationServices services = new NotificationServices(manager.Object); var expectedOutput = await services.PushNotificationsAsync(objectToBeSentinServiceLayer); Assert.AreEqual(expectedOutput.Id, objectToBeSentinServiceLayer.Id); Assert.AreEqual(expectedOutput.Message, objectToBeSentinServiceLayer.Message); }