public void subForumCreationTest() { int id1 = fm.CreateForum(titels[0]); int userId = fm.Register(userNames[0], passwords[0], emails[0], id1); fm.AddAdmin(userId, id1); Assert.AreNotEqual(-1, fm.CreateSubForum(subTitels[0], id1, userId)); fm.RemoveForum(id1); }
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); }
public void addThreadTest() { int forumId = fm.CreateForum(titels[0]); int userId = fm.Register(userNames[0], passwords[0], emails[0], forumId); fm.AddAdmin(userId, forumId); int subForumId = fm.CreateSubForum(subTitels[0], forumId, userId); int threadId1 = mm.addThread(forumId, subForumId, userId, topic[0], body[0]); int threadId2 = mm.addThread(forumId, subForumId, userId, topic[1], body[0]); Assert.AreNotEqual(threadId1, threadId2); fm.RemoveForum(forumId); }
public void creatingSubForumReturnsDiffIDTest() { int id1 = fm.CreateForum(titels[0]); int userId = fm.Register(user[0], user[1], user[2], id1); fm.AddAdmin(userId, id1); int id2 = fm.CreateSubForum(subTitels[1], id1, userId); int id3 = fm.CreateSubForum(subTitels[0], id1, userId); Assert.AreNotEqual(id1, id2); fm.RemoveForum(id1); }
public void AddAdmin(int userRequesterId, int forumId, int adminId) { FM.AddAdmin(userRequesterId, adminId, forumId); }
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); }