public async Task ThenTheMediatorIsCalledToRetrieveTheInvitations() { //Arrange var userId = "123abc"; //Act var actual = await _invitationOrchestrator.GetAllInvitationsForUser(userId); //Assert _mediator.Verify(x => x.SendAsync(It.Is <GetUserInvitationsRequest>(c => c.UserId.Equals(userId))), Times.Once); Assert.IsAssignableFrom <UserInvitationsViewModel>(actual.Data); }
public async Task <ActionResult> All() { if (string.IsNullOrEmpty(OwinWrapper.GetClaimValue("sub"))) { return(RedirectToAction("Index", "Home")); } var model = await _invitationOrchestrator.GetAllInvitationsForUser(OwinWrapper.GetClaimValue("sub")); return(View(model)); }
public async Task <ActionResult> All() { if (string.IsNullOrEmpty(OwinWrapper.GetClaimValue(ControllerConstants.UserRefClaimKeyName))) { return(RedirectToAction(ControllerConstants.IndexActionName, ControllerConstants.HomeControllerName)); } var model = await _invitationOrchestrator.GetAllInvitationsForUser(OwinWrapper.GetClaimValue("sub")); return(View(model)); }