public void TryDelete() { var testUserController = new WebAPI.Controllers.UserController(); int lastUserId = testUserController.Get().Last().Id; var userFromController = testUserController.Delete(lastUserId); Assert.AreEqual(userFromController, 1); var testUser = testUserController.Get(lastUserId); Assert.IsNull(testUser); }
public void TryGet1Recover() { var testUserController = new WebAPI.Controllers.UserController(); var userFromController = testUserController.Get(1); Assert.AreEqual(userFromController.Id, 1); }
public void TryGetExist() { var testUserController = new WebAPI.Controllers.UserController(); var userFromController = testUserController.Get(); Assert.IsNotNull(userFromController); }
public void TryEdit() { var testUserController = new WebAPI.Controllers.UserController(); var lastUser = testUserController.Get().Last(); var newName = Guid.NewGuid().ToString(); var userFromController = testUserController.Put( lastUser.Id, new User { Name = newName, Birthdate = lastUser.Birthdate }); Assert.AreEqual(userFromController, 1); var testUser = testUserController.Get(lastUser.Id); Assert.AreEqual(testUser.Name, newName); }