本文整理汇总了C#中AllReady.Areas.Admin.Controllers.SiteController.ConfirmDeleteUser方法的典型用法代码示例。如果您正苦于以下问题:C# SiteController.ConfirmDeleteUser方法的具体用法?C# SiteController.ConfirmDeleteUser怎么用?C# SiteController.ConfirmDeleteUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AllReady.Areas.Admin.Controllers.SiteController
的用法示例。
在下文中一共展示了SiteController.ConfirmDeleteUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfirmDeletUserSendsDeleteUserCommandAsync
public async Task ConfirmDeletUserSendsDeleteUserCommandAsync()
{
var mediator = new Mock<IMediator>();
var controller = new SiteController(null, null, null, null, mediator.Object);
const string userId = "foo_id";
await controller.ConfirmDeleteUser(userId);
mediator.Verify(b => b.SendAsync(It.Is<DeleteUserCommand>(u => u.UserId == userId)));
}
示例2: ConfirmDeletUserRedirectsToCorrectAction
public async Task ConfirmDeletUserRedirectsToCorrectAction()
{
var applicationUser = CreateApplicationUserMock();
var controller = new SiteController(applicationUser.Object, null, null);
var result = await controller.ConfirmDeleteUser(It.IsAny<string>()) as RedirectToActionResult;
Assert.Equal(result.ActionName, nameof(SiteController.Index));
}
示例3: ConfirmDeletUserInvokesFindByIdAsync
public async Task ConfirmDeletUserInvokesFindByIdAsync()
{
const string userId = "userId";
var userManager = CreateApplicationUserMock();
var controller = new SiteController(userManager.Object, null, null);
await controller.ConfirmDeleteUser(userId);
userManager.Verify(x => x.FindByIdAsync(userId), Times.Once);
}