Пример #1
0
        public void TestAddProblem()
        {
            ProblemDataManager dataManager = new ProblemDataManager();

            dataManager.AddProblem("Skill1", "Group1", "Problem1", 0, 0, 0);
            Assert.AreEqual(1, dataManager.GetProblemCount());
        }
Пример #2
0
        public void TestGetProblemsFromGroup()
        {
            ProblemDataManager dataManager = new ProblemDataManager();

            dataManager.AddProblem("Skill1", "Group1", "Problem1", 1, 0, 1);
            dataManager.AddProblem("Skill1", "Group2", "Problem2", 0, 0, 0);
            dataManager.AddProblem("Skill1", "Group1", "Problem3", 1, 0, 2);
            Assert.AreEqual(3, dataManager.GetProblemCount());

            Assert.AreEqual(1, dataManager.GetProblemsFromGroup(1, "Group1").Count);
            Assert.AreEqual(2, dataManager.GetProblemsFromGroup(2, "Group1").Count);

            Assert.AreEqual("Problem1", dataManager.GetProblemsFromGroup(2, "Group1")[0]);
            Assert.AreEqual("Problem3", dataManager.GetProblemsFromGroup(2, "Group1")[1]);

            dataManager.MarkCompleted("Problem1", true);

            Assert.AreEqual(2, dataManager.GetProblemsFromGroup(2, "Group1").Count);
            Assert.AreEqual("Problem3", dataManager.GetProblemsFromGroup(2, "Group1")[0]);
            Assert.AreEqual("Problem1", dataManager.GetProblemsFromGroup(2, "Group1")[1]);
        }