Example #1
0
 public void Controller_UpdateUser_State_NothingUpdated()
 {
     controller = Controller.GetInstance();
     RentItServer.ITU.DatabaseWrapperObjects.User user = TestExtensions._testUser1;
     try
     {
         controller.UpdateUser(user.Id, null, null, null);
         User updatedUser = _dao.GetUser(user.Id);
         Assert.IsTrue(user.Username.Equals(updatedUser.Username));
         Assert.IsTrue(user.Email.Equals(updatedUser.Email));
     }
     catch (Exception e)
     {
         Assert.Fail("An exception was thrown. " + e);
     }
 }
Example #2
0
 public void Controller_UpdateUser_Parameter_PosNullNullValid()
 {
     controller = Controller.GetInstance();
     RentItServer.ITU.DatabaseWrapperObjects.User user = TestExtensions._testUser1;
     testId = user.Id;
     try
     {
         controller.UpdateUser(testId, null, null, testpw);
         Assert.Fail("No exception was thrown");
     }
     catch (ArgumentException)
     {
         //This is expected
     }
 }
Example #3
0
 public void Controller_UpdateUser_State_EverythingUpdated()
 {
     controller = Controller.GetInstance();
     RentItServer.ITU.DatabaseWrapperObjects.User user = TestExtensions._testUser1;
     try
     {
         string newName = "newtestname";
         string newPw = "thisisanewpassword";
         string newEmail = "*****@*****.**";
         controller.UpdateUser(user.Id, newName, newPw, newEmail);
         User updatedUser = _dao.GetUser(user.Id);
         Assert.IsTrue(updatedUser.Username.Equals(newName));
         Assert.IsTrue(updatedUser.Email.Equals(newEmail));
         Assert.IsTrue(updatedUser.Password.Equals(newPw));
     }
     catch (Exception e)
     {
         Assert.Fail("An exception was thrown. " + e);
     }
 }
Example #4
0
 public void Controller_UpdateUser_Parameter_PosNullNullNull()
 {
     controller = Controller.GetInstance();
     RentItServer.ITU.DatabaseWrapperObjects.User user = TestExtensions._testUser1;
     try
     {
         controller.UpdateUser(user.Id, null, null, null);
     }
     catch (ArgumentNullException e)
     {
         Assert.Fail("An exception was thrown. " + e);
     }
 }