public async Task SearchForNonExistingUser() { swaggerClient client = new swaggerClient(baseUrl, httpClient); ApiException <ProblemDetails> exception = await Assert.ThrowsExceptionAsync <ApiException <ProblemDetails> >( () => client.Users2Async($"{Guid.NewGuid()}@foo.bar")); Assert.AreEqual(404, exception.StatusCode); }
public async Task CreateThenFindUser() { swaggerClient client = new swaggerClient(baseUrl, httpClient); CreateUserCommand command = new CreateUserCommand() { FirstName = "Some", MiddleName = "Tandem", LastName = "User", PhoneNumber = "111-222-3333", EmailAddress = $"{Guid.NewGuid()}@foo.bar" }; await client.UsersAsync(command); UserDetailView savedUser = await client.Users2Async(command.EmailAddress); string expectedName = $"{command.FirstName} {command.MiddleName} {command.LastName}"; Assert.AreEqual(expectedName, savedUser.Name); Assert.AreEqual(command.EmailAddress, savedUser.EmailAddress); Assert.AreEqual(command.EmailAddress, savedUser.EmailAddress); }