public async Task <IActionResult> ToggleBlockCharacter(ToggleBlockCharacterRequest request) { var response = await mediator.Send(request); Log.Information( $"User #{HttpContext.GetCurrentUserId()} {(response.IsBlocked ? "blocked" : "unblocked")} character #{request.CharacterId}"); return(this.CreateResponse(response)); }
public void SetUp() { request = new ToggleBlockCharacterRequest(); characterManager = new Mock <ICharacterManager>(); var httpContextReader = new Mock <IHttpContextReader>(); var notifier = new Mock <INotifier>(); var hubManager = new Mock <IHubManager <NotifierHub> >(); var mapper = new Mock <IMapper>(); characterManager.Setup(cm => cm.ToggleBlockCharacter(request.CharacterId)) .ReturnsAsync(new BlockCharacterResult(true, It.IsNotNull <bool>(), "test", 1)); toggleBlockCharacterCommand = new ToggleBlockCharacterCommand(characterManager.Object, httpContextReader.Object, notifier.Object, hubManager.Object, mapper.Object); }