public void TestRandomize(int problemSetSize, int totalProblems, bool isCorrect) { string s1 = "s1"; string g1 = "g1"; string sgp = s1 + g1 + "-"; SkillsDataManager sdm = new SkillsDataManager(); sdm.AddSkill(s1, false); ProblemDataManager pdm = new ProblemDataManager(); for (int i = 0; i < totalProblems; i++) { pdm.AddProblem(s1, g1, sgp + i.ToString(), 0, 0, 0); } //Hold the completed problems for later comparison IList <string> completedList = new List <string>(); for (int i = 0; i < totalProblems / problemSetSize; i++) { DefaultAssessmentBuilder dab = new DefaultAssessmentBuilder(pdm, sdm); dab.AddProblem(problemSetSize, g1, "randgrp321"); Assessment assess = dab.Build(); IList <string> probs = assess.GetProblemSequence(); foreach (string prob in probs) { pdm.MarkCompleted(prob, isCorrect); Assert.IsFalse(completedList.Contains(prob), prob + ": Already in List"); completedList.Add(prob); } } }
public void TestAddSkill() { SkillsDataManager dataManager = new SkillsDataManager(); dataManager.AddSkill("Skill1", false); dataManager.AddSkill("Skill2", false); Assert.AreEqual(2, dataManager.GetSkillCount()); }
public void TestCase() { ProblemDataManager pdm = new ProblemDataManager(); SkillsDataManager sdm = new SkillsDataManager(); DefaultAssessmentBuilder dab = new DefaultAssessmentBuilder(pdm, sdm); Assert.IsNotNull(dab); }
public void BasicTest() { AssetsDataManager adm = new AssetsDataManager(); ProblemDataManager pdm = new ProblemDataManager(); SkillsDataManager sdm = new SkillsDataManager(); GroupLinkageManager glm = new GroupLinkageManager(adm, pdm); ProblemLinkageManager plm = new ProblemLinkageManager(adm); DefaultAssetRecommendationEngine dare = new DefaultAssetRecommendationEngine(adm, sdm, glm, plm); Assert.IsNotNull(dare); }
public void TestStoreData() { SkillsDataManager dataManager = new SkillsDataManager(); dataManager.AddSkill("Skill1", false); dataManager.AddSkill("Skill2", false); SkillsMockDataStorageDelegate storage = new SkillsMockDataStorageDelegate(); dataManager.StoreData(storage); Assert.AreEqual(2, storage.callCount); }
public void TestSetSkillComplete() { SkillsDataManager dataManager = new SkillsDataManager(); dataManager.AddSkill("Skill1", false); dataManager.AddSkill("Skill2", false); Assert.IsFalse(dataManager.IsSkillComplete("Skill1")); Assert.IsFalse(dataManager.IsSkillComplete("Skill2")); dataManager.SetSkillComplete("Skill1", true); Assert.IsTrue(dataManager.IsSkillComplete("Skill1")); Assert.IsFalse(dataManager.IsSkillComplete("Skill2")); }
public void TestVisit() { SkillsDataManager dataManager = new SkillsDataManager(); dataManager.AddSkill("Skill1", false); dataManager.AddSkill("Skill2", false); int callCount = 0; dataManager.Visit(delegate(string skill, bool complete){ callCount += 1; }); Assert.AreEqual(2, callCount); }
private void createAssetsSkills(int skillCount, int assetTypesCount, int assetCount, out AssetsDataManager adm, out SkillsDataManager sdm) { adm = new AssetsDataManager(); pdm = new ProblemDataManager(); sdm = new SkillsDataManager(); glm = new GroupLinkageManager(adm, pdm); plm = new ProblemLinkageManager(adm); for (int skillId = 0; skillId < skillCount; skillId++) { sdm.AddSkill(skillIdPrefix + skillId.ToString(), false); for (int assetTypeId = 0; assetTypeId < assetTypesCount; assetTypeId++) { for (int assetId = 0; assetId < assetCount; assetId++) { adm.AddAsset(skillIdPrefix + skillId, assetTypePrefix + assetTypeId, assetIdPrefix + assetId, 0, 0, 0); } } } }
public void TestBasicAssessment() { SkillsDataManager sdm = new SkillsDataManager(); sdm.AddSkill("s1", false); ProblemDataManager pdm = new ProblemDataManager(); pdm.AddProblem("s1", "grp1", "s1g1-1", 0, 0, 0); DefaultAssessmentBuilder dab = new DefaultAssessmentBuilder(pdm, sdm); dab.AddProblem(1, "grp1", "randomGrp"); Assessment assess = dab.Build(); Assert.IsNotNull(assess); IList <string> probIds = assess.GetProblemSequence(); Assert.AreEqual(probIds.Count, 1); Assert.AreEqual(probIds[0], "s1g1-1"); }
public SkillsBusinessManager(TSPEntities dbconn) { skillDataManager = new SkillsDataManager(dbconn); }