Exemplo n.º 1
0
        public void WrongPasswordWhenTryLoginAsAdmin()
        {
            tc.PrepareDBForTests();
            Administrator admin = tc.CreateRandomAdministrator();

            admin.Admin_Number = tc.adminFacade.CreateNewAdmin(tc.adminToken, admin);
            FlyingCenterSystem.GetUserAndFacade(admin.User_Name, "ErrorPassword", out ILogin token, out FacadeBase facade);
        }
        public void TestForAdministratorsController()
        {
            tc.PrepareDBForTests();
            User          user  = new User(FlyingCenterConfig.ADMIN_NAME, FlyingCenterConfig.ADMIN_PASSWORD, UserType.Administrator);
            string        token = GetTokenAsync(user);
            Administrator admin = tc.CreateRandomAdministrator();

            CreateAdmin(token, CreateAdminUrl, admin);
            Administrator myAdmin = GetAdminByUserName(token, GetAdminUrl + admin.User_Name);

            Assert.AreEqual(myAdmin.User_Name, admin.User_Name);
        }
Exemplo n.º 3
0
        public void RemoveAdministratorSuccessfully()
        {
            tc.PrepareDBForTests();
            Administrator admin = tc.CreateRandomAdministrator();

            admin.Admin_Number = tc.adminFacade.CreateNewAdmin(tc.adminToken, admin);
            tc.adminFacade.RemoveAdministrator(tc.adminToken, admin);
            Assert.AreEqual(tc.adminFacade.GetAdminByUserName(tc.adminToken, admin.User_Name).Id, 0);
        }