Ejemplo n.º 1
0
        public void addAdminTest()
        {
            int id1    = fm.CreateForum(1, titels[0]);
            int userId = fm.Register(user[0], user[1], user[2], id1);

            fm.AddAdmin(1, userId, id1);
            Assert.IsTrue(fm.IsAdmin(userId, id1));
            fm.RemoveAdmin(1, userId, id1);
            fm.UnRegister(userId, id1);
            fm.RemoveForum(1, id1);
        }
Ejemplo n.º 2
0
        public void AddThreadTest()
        {
            int forumId = fm.CreateForum(1, titels[0]);
            int userId  = fm.Register(userNames[0], passwords[0], emails[0], forumId);

            fm.AddAdmin(1, userId, forumId);
            int subForumId = fm.CreateSubForum(1, subTitels[0], forumId);
            int threadId1  = mm.addThread(forumId, subForumId, userId, userNames[0], topic[0], body[0]);
            int threadId2  = mm.addThread(forumId, subForumId, userId, userNames[0], topic[1], body[0]);

            Assert.AreEqual(mm.GetTotalMessagesCount(), 2);
            Assert.AreNotEqual(threadId1, threadId2);
            fm.UnRegister(userId, forumId);
            fm.RemoveForum(1, forumId);
        }