Example #1
0
        public void TryChangePasswordForAdministrator()
        {
            Administrator admin = CreateRandomAdministrator();

            adminFacade.CreateNewAdmin(adminToken, admin);
            FlyingCenterSystem.GetUserAndFacade(admin.User_Name, admin.Password, out ILogin token, out FacadeBase facade);
            LoginToken <Administrator>  newToken  = token as LoginToken <Administrator>;
            LoggedInAdministratorFacade newFacade = facade as LoggedInAdministratorFacade;

            newFacade.ChangeMyPassword(newToken, "123".ToUpper(), "newPassword".ToUpper());
            Assert.AreEqual(newToken.User.Password.ToUpper(), "newPassword".ToUpper());
        }
        public void TryChangePasswordForAdministrator()
        {
            tc.PrepareDBForTests();
            Administrator admin = new Administrator("Admin: " + tc.UserTest(), "123");

            tc.adminFacade.CreateNewAdmin(tc.adminToken, admin);
            FlyingCenterSystem.TryGetUserAndFacade(admin.User_Name, admin.Password, out ILogin token, out FacadeBase facade);
            LoginToken <Administrator>  newToken  = token as LoginToken <Administrator>;
            LoggedInAdministratorFacade newFacade = facade as LoggedInAdministratorFacade;

            newFacade.ChangeMyPassword(newToken, "123".ToUpper(), "newPassword".ToUpper());
            Assert.AreEqual(newToken.User.Password.ToUpper(), "newPassword".ToUpper());
        }
Example #3
0
        public void ChangePasswordForAdministrator()
        {
            TestCenter.PrepareDBForTests(out LoginToken <Administrator> adminToken, out LoggedInAdministratorFacade adminFacade);
            Administrator adminForPassword = new Administrator {
                User_Name = TestCenter.UserTest(), Password = "******"
            };

            adminFacade.CreateNewAdmin(adminToken, adminForPassword);
            FlyingCenterSystem.TryLogin(adminForPassword.User_Name, adminForPassword.Password, out ILogin token, out FacadeBase facade);
            LoginToken <Administrator>  newToken  = token as LoginToken <Administrator>;
            LoggedInAdministratorFacade newFacade = facade as LoggedInAdministratorFacade;

            newFacade.ChangeMyPassword(newToken, "123", "newPassword");
            Assert.AreEqual(newToken.User.Password, "newPassword".ToUpper());
        }