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" }); }
public void PresentsUserContactInformation() { var presenter = new UserDetailsPresenterSimulator(); var userOperations = new UserOperations( new CustomersInformationStoreSimulator() .ForCustomerWithNumber(ACustomerNumber) .ReturnsCustomerWith(ACustomerCspId), new MicrosoftOffice365UsersOperationsSimulator() .ForCustomerWithId(ACustomerCspId) .AndUser(AUserName) .ReturnsUser(AUser .WithUserName(AUserName) .WithFirstName(AUserFirstName) .WithLastName(AUserLastName)), new MicrosoftOffice365SubscriptionsOperationsSimulator()); userOperations.GetUserDetails(AGetUserDetaisCommandWith(ACustomerNumber, AUserName), presenter); presenter.HasPresentedUserDataWith(AUserName, AUserFirstName, AUserLastName); }