public void HaveNotFoundResultByDefault() { var presenter = new UserDetailsPresenter(); presenter.Result.Should() .BeOfType <NotFoundResult>(); }
public void HaveNotFoundResultWhenNullValueIsPassedForFormatting() { var presenter = new UserDetailsPresenter(); presenter.Present(null); presenter.Result.Should() .BeOfType <NotFoundResult>(); }
public IActionResult GetOne( [FromRoute(Name = "number")] string customerNumber, [FromRoute(Name = "name")] string userName) { var command = new GetUserDetailsCommand { CustomerNumber = customerNumber, UserName = userName }; var presenter = new UserDetailsPresenter(); userOperations.GetUserDetails(command, presenter); return(presenter.Result); }
public void HaveOkResultWithCorrectContentWhenUserIsPassedForFormatting() { var presenter = new UserDetailsPresenter(); presenter.Present( AUser.WithUserName("*****@*****.**") .WithFirstName("FirstName") .WithLastName("LastName")); presenter.Result.Should() .BeOfType <OkObjectResult>() .Which.Value.Should() .BeEquivalentTo( new UserDetailsResponse { Email = "*****@*****.**", FullName = "FirstName LastName" }); }