Esempio n. 1
0
        public void EnsurePersistencyForAdmin()
        {
            module.updateUserInfo(AdminDeterminedByConfig, true);
            module = new UsersModule(new TestUserHandler(), MakeConfig());

            Assert.IsTrue(module.admincheck(AdminDeterminedByConfig));
        }
Esempio n. 2
0
 private void Initialize()
 {
     Users      = new UsersModule();
     Notes      = new NotesModule();
     Events     = new EventsModule();
     Insurances = new InsurancesModule();
     Database   = new LocalDatabase();
     Database.OpenConnections();
 }
Esempio n. 3
0
        public async Task SetPassword() {
            var users = new UsersModule(Client);
            long userId = Convert.ToInt64(ConfigurationManager.AppSettings["set_password_userId"]);
            string password = ConfigurationManager.AppSettings["set_password_password"];

            var result = await users.SetPasswordAsync(userId, password);

            Assert.True(result.Success);
            Assert.NotNull(result.Data);
        }
Esempio n. 4
0
        public async Task Update() {
            var users = new UsersModule(Client);
            var result = await users.GetAsync(69949);
            var user = result.Data;
            user.FirstName = "ORION_TEST";

            result = await users.UpdateAsync(user);

            Assert.True(result.Success);
            Assert.NotNull(result.Data);
        }
Esempio n. 5
0
        public void Cleanup()
        {
            module = new UsersModule(new TestUserHandler(), MakeConfig());

            module.admins.Clear();
            module.bans.Clear();

            module.savePersistentData();
            module.loadPersistentData();

            Assert.IsTrue(module.admins.Count == 0);
            Assert.IsTrue(module.bans.Count == 0);
        }
Esempio n. 6
0
        public void Initialize()
        {
            module = new UsersModule(new TestUserHandler(), MakeConfig());

            Admin      = new ChatroomEntity(AdminIdentifier, null);
            Admin.Rank = ChatroomEntity.AdminStatus.True;

            NonAdmin      = new ChatroomEntity(NonAdminIdentifier, null);
            NonAdmin.Rank = ChatroomEntity.AdminStatus.False;

            UnknownUser      = new ChatroomEntity(UnknownUserIdentifier, null);
            UnknownUser.Rank = ChatroomEntity.AdminStatus.Unknown;

            OtherUser      = new ChatroomEntity(OtherUserIdentifier, null);
            OtherUser.Rank = ChatroomEntity.AdminStatus.Other;

            AdminDeterminedByConfig      = new ChatroomEntity(AdminDeterminedByConfigIdentifier, null);
            AdminDeterminedByConfig.Rank = ChatroomEntity.AdminStatus.False;
        }
Esempio n. 7
0
 public CheckStatus(ModuleHandler bot, UsersModule module) : base(bot, "!CheckAdmin")
 {
     this.module = module;
 }