public void UnitTestForumPolicyModeratorsGettersSetters()
        {
            ForumPolicy fp = new ForumPolicy();

            fp.setMaxModerators(0);
            Assert.IsTrue(fp.getMaxModerators() != 0);
            Assert.IsTrue(fp.getMaxModerators() == 10);
            fp.setMaxModerators(11);
            Assert.IsTrue(fp.getMaxModerators() == 11);
            fp.setMinModerators(12);
            Assert.IsTrue(fp.getMinModerators() != 12);
            Assert.IsTrue(fp.getMinModerators() == 1);
            fp.setMinModerators(2);
            Assert.IsTrue(fp.getMinModerators() == 2);
        }
        public string checkForumPolicy(string forumName, ForumPolicy policy)
        {
            List <string> input = new List <string>()
            {
                forumName
            };

            if (Constants.isValidInput(input) && policy != null)
            {
                lock (o)
                {
                    int numOfAdmins           = _um.getNumOfAdmins(forumName);
                    int maxNumOfModerators    = _um.getMaxModerators(forumName);
                    int minNumOfModerators    = _um.getMinModerators(forumName);
                    int minModeratorSeniority = _um.getMinModeratorSeniority(forumName);
                    if (numOfAdmins > policy.getMaxAdmins())
                    {
                        return("Forum " + forumName + " has " + numOfAdmins + " admins. Cannot set max num of admins to " + policy.getMaxAdmins());
                    }
                    if (numOfAdmins < policy.getMinAdmins())
                    {
                        return("Forum " + forumName + " has " + numOfAdmins + " admins. Cannot set min num of admins to " + policy.getMinAdmins());
                    }
                    if (maxNumOfModerators > policy.getMaxModerators())
                    {
                        return("One of forum " + forumName + " sub forums has " + maxNumOfModerators + " moderators. Cannot set max num of moderators to " + policy.getMaxModerators());
                    }
                    if (minNumOfModerators < policy.getMinModerators())
                    {
                        return("One of forum " + forumName + " sub forums has " + minNumOfModerators + " moderators. Cannot set min num of moderators to " + policy.getMinModerators());
                    }
                    if (minModeratorSeniority < policy.getSeniority())
                    {
                        return("One of the moderators of forum " + forumName + " has a seniority of " + minModeratorSeniority + " days. Cannot set minimum seniotiry to " + policy.getSeniority());
                    }
                    return(Constants.SUCCESS);
                }
            }
            return(Constants.INVALID_INPUT);
        }