Beispiel #1
0
        public void Output_Success()
        {
            // Arrange
            var output = CreateUserProfileOutput();

            // Act
            presenter.Output(output);
            var viewModel = presenter.GetViewModel();

            // Arrange
            viewModel.Should().NotBeNull();
            Approvals.VerifyJson(JsonConvert.SerializeObject(viewModel));
        }
Beispiel #2
0
        public async Task <IActionResult> Index(Guid id)
        {
            var presenter     = new MvcGetUserProfilePresenter();
            var useCaseResult = await mediator.Send(new GetUserProfile(id, presenter));

            if (!useCaseResult.IsSuccessful)
            {
                return(useCaseResult.ResultCategory == ResultCategory.NotFound
                    ? NotFound()
                    : StatusCode(500));
            }

            return(View(presenter.GetViewModel()));
        }