Exemple #1
0
        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);
        }
Exemple #2
0
        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));
        }