public void NullToken() { LoginToken <Admin> myToken = null; LoggedInAdministratorFacade myFacade = new LoggedInAdministratorFacade(); myFacade.GetAdminByid(myToken, "3"); }
public void RemoveAdminAndHisUserRepository() { UserRepository testUr = new UserRepository("dad", "aes", RolesEnum.admin); Admin testAdmin = new Admin("dav,", "id", 3); FlyingCenterSystem.GetInstance().TryLogin(ur.UserName, ur.Password, out ILogin token, out FacadeBase facade); LoginToken <Admin> myToken = token as LoginToken <Admin>; LoggedInAdministratorFacade myFacade = facade as LoggedInAdministratorFacade; myFacade.CreateNewAdmin(myToken, testUr, testAdmin); myFacade.RemoveAdmin(myToken, testAdmin.UserRepositoryID.ToString()); Admin admin2 = myFacade.GetAdminByid(myToken, testAdmin.ID.ToString()); }
public void UpdateAdmin() { UserRepository testUr = new UserRepository("dad", "aes", RolesEnum.admin); Admin testAdmin = new Admin("dav,", "id", 3); FlyingCenterSystem.GetInstance().TryLogin(ur.UserName, ur.Password, out ILogin token, out FacadeBase facade); LoginToken <Admin> myToken = token as LoginToken <Admin>; LoggedInAdministratorFacade myFacade = facade as LoggedInAdministratorFacade; myFacade.CreateNewAdmin(myToken, testUr, testAdmin); Admin admin2 = myFacade.GetAdminByid(myToken, testAdmin.ID.ToString()); testAdmin.FirstName = "tts"; myFacade.UpdateAdminDetails(myToken, testAdmin); Assert.AreNotEqual(admin2.FirstName, testAdmin.FirstName); }