public async Task Delete_ShouldCallNotificationsRepositoryRemove() { var called = false; var userChannel = "http://www.mycompany.com/testChannel"; var userNotificationType = NotificationType.WindowsPhoneNotification; var notificationChannelRepository = new Data.Repositories.Fakes.StubINotificationChannelRepository(); notificationChannelRepository.RemoveUserChannelAsyncStringStringNotificationType = (userIdentity, channel, notificationType) => { Assert.AreEqual(userChannel, channel); Assert.AreEqual(userNotificationType, notificationType); called = true; return(Task.FromResult(string.Empty)); }; var notificationsController = new NotificationsController(notificationChannelRepository, new SecurityHelper()); await notificationsController.Delete(new Models.ClientNotificationChannel { ChannelUri = userChannel, NotificationType = userNotificationType }); Assert.IsTrue(called); }