public async Task DeleteUser() { var users = await _usersController.GetUsers(); var user = DesirializeToList <User>(await users.Content.ReadAsStringAsync(), "data").PickRandomItem(); var response = await _usersController.Delete(user.Id); Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.OK)); }
public void Users() { Utils.UseApiEnvironment((_, api, token) => { using (var baseClient = api.CreateClient()) { IUsersClient client = new UsersClient(baseClient); Assert.IsFalse(client.GetAll(token).Result.Any()); Assert.IsNull(client.Get(token, "0").Result); client.Clear(token).Wait(); { User tag = new User { Name = "user" }; string id = client.Create(token, Guid.NewGuid().ToString(), tag).Result; Assert.AreEqual(tag.Name, client.Get(token, id).Result?.Name); tag.Name = "user2"; Assert.IsNotNull(client.Update(token, id, tag).Result); Assert.IsNotNull(client.Delete(token, id).Result); } } }); }
public void Delete_NoIdOrUserIdOrEmail_ThrowException() { Assert.Throws <ArgumentException>(() => usersClient.Delete(new User())); }
public void Delete_NoIdOrUserIdOrEmail_ThrowException() { usersClient.Delete(new User()); }