public async Task Should_create_new_user_in_aad(UserType userType) { const string EMAIL_STEM = EmailData.FAKE_EMAIL_STEM; var userRequest = new UserBuilder(EMAIL_STEM, 1) .WithUserType(userType) .ForApplication(Application.TestApi) .BuildRequest(); var newUserResponse = new NewUserResponse { OneTimePassword = "******", UserId = "1234", Username = userRequest.Username }; UserApiClient.Setup(x => x.CreateUserAsync(It.IsAny <CreateUserRequest>())).ReturnsAsync(newUserResponse); UserApiClient.Setup(x => x.AddUserToGroupAsync(It.IsAny <AddUserToGroupRequest>())) .Returns(Task.CompletedTask); var userDetails = await UserApiService.CreateNewUserInAAD(userRequest.FirstName, userRequest.LastName, userRequest.ContactEmail, userRequest.IsProdUser); userDetails.OneTimePassword.Should().Be(newUserResponse.OneTimePassword); userDetails.UserId.Should().Be(newUserResponse.UserId); userDetails.Username.Should().Be(newUserResponse.Username); }