Exemple #1
0
        public void TestAddAsset()
        {
            AssetsDataManager dataManager = new AssetsDataManager();

            dataManager.AddAsset("Skill", "Type", "ID0", 0, 0, 0);
            Assert.AreEqual(1, dataManager.GetAssetCount());
        }
Exemple #2
0
        public void BasicTest()
        {
            AssetsDataManager     alm = new AssetsDataManager();
            ProblemLinkageManager plm = new ProblemLinkageManager(alm);

            Assert.IsNotNull(plm);
        }
Exemple #3
0
        public void NullGroupId()
        {
            AssetsDataManager   alm = new AssetsDataManager();
            ProblemDataManager  plm = new ProblemDataManager();
            GroupLinkageManager glm = new GroupLinkageManager(alm, plm);

            Assert.IsNull(glm.getAssets("groupId"));
        }
Exemple #4
0
        public void BasicCtorTest()
        {
            AssetsDataManager   alm = new AssetsDataManager();
            ProblemDataManager  plm = new ProblemDataManager();
            GroupLinkageManager glm = new GroupLinkageManager(alm, plm);

            Assert.IsNotNull(glm);
        }
Exemple #5
0
        public void AddLinkage()
        {
            AssetsDataManager     alm = new AssetsDataManager();
            ProblemLinkageManager plm = new ProblemLinkageManager(alm);

            plm.AddProblemLinkage("id", new string [] { "asset1" });
            Assert.AreEqual("asset1", plm.GetAssets("id")[0]);
        }
Exemple #6
0
        public void TestGetAssetsFor()
        {
            AssetsDataManager dataManager = new AssetsDataManager();

            dataManager.AddAsset("Skill", "Type", "ID0", 0, 0, 0);
            IList <AssetRecomendation> assets = dataManager.GetAssetsFor("Skill");

            Assert.AreEqual(1, assets.Count);
        }
Exemple #7
0
        public void TestGetAssetsTypes()
        {
            AssetsDataManager dataManager = new AssetsDataManager();

            dataManager.AddAsset("Skill", "Type", "ID0", 0, 0, 0);
            dataManager.AddAsset("Skill", "Type2", "ID1", 0, 0, 0);
            Assert.AreEqual(2, dataManager.GetAssetsTypes().Count);
            Assert.AreEqual("Type", dataManager.GetAssetsTypes()[0]);
            Assert.AreEqual("Type2", dataManager.GetAssetsTypes()[1]);
        }
Exemple #8
0
        public void  AddAssetTest()
        {
            string              groupId = "groupId";
            AssetsDataManager   alm     = new AssetsDataManager();
            ProblemDataManager  plm     = new ProblemDataManager();
            GroupLinkageManager glm     = new GroupLinkageManager(alm, plm);

            glm.addAssets(groupId, new string[] { "asset1" });
            Assert.AreEqual(1, glm.getAssets(groupId).Count);
        }
Exemple #9
0
        public void TestStoreData()
        {
            AssetsDataManager dataManager = new AssetsDataManager();

            dataManager.AddAsset("Skill", "Type", "ID0", 0, 0, 0);
            dataManager.AddAsset("Skill", "Type2", "ID1", 0, 0, 0);
            MockDataStorageDelegate storage = new MockDataStorageDelegate();

            dataManager.StoreData(storage);
            Assert.AreEqual(2, storage.callCount);
        }
Exemple #10
0
        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);
        }
Exemple #11
0
        public void AddAssetsToExistingEmptyList()
        {
            string              groupId = "groupId";
            AssetsDataManager   alm     = new AssetsDataManager();
            ProblemDataManager  plm     = new ProblemDataManager();
            GroupLinkageManager glm     = new GroupLinkageManager(alm, plm);

            glm.addGroupId(groupId);
            glm.addAssets(groupId, new string [] { "assets" });
            Assert.AreEqual("assets", glm.getAssets(groupId)[0]);
        }
Exemple #12
0
        public void AddMultipleProblemLinks()
        {
            AssetsDataManager     alm = new AssetsDataManager();
            ProblemLinkageManager plm = new ProblemLinkageManager(alm);

            plm.AddProblemLinkage("id1", "asset1");
            plm.AddProblemLinkage("id2", new string [] { "asset2", "asset3" });

            Assert.AreEqual("asset1", plm.GetAssets("id1")[0]);
            Assert.AreEqual("asset2", plm.GetAssets("id2")[0]);
            Assert.AreEqual("asset3", plm.GetAssets("id2")[1]);
        }
Exemple #13
0
        public void AddDuplicateAssetToExistingList()
        {
            string groupId = "groupId";

            string []           asset = new string [] { "asset1" };
            AssetsDataManager   alm   = new AssetsDataManager();
            ProblemDataManager  plm   = new ProblemDataManager();
            GroupLinkageManager glm   = new GroupLinkageManager(alm, plm);

            glm.addAssets(groupId, asset);
            Assert.AreEqual(1, glm.getAssets(groupId).Count);

            glm.addAssets(groupId, asset);
            Assert.AreEqual(1, glm.getAssets(groupId).Count);
        }
Exemple #14
0
        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);
                    }
                }
            }
        }
Exemple #15
0
        public void TestMarkAssetCompleted()
        {
            AssetsDataManager dataManager = new AssetsDataManager();

            dataManager.AddAsset("Skill", "Type", "ID0", 0, 0, 0);
            IList <AssetRecomendation> assets = dataManager.GetAssetsFor("Skill");

            Assert.AreEqual(0, assets[0].GetTimesUsed());
            Assert.AreEqual(0, assets[0].GetLastAccessed());
            Assert.AreEqual(0, assets[0].GetFirstAccessed());

            dataManager.MarkAssetCompleted("ID0");
            Assert.AreEqual(1, assets[0].GetTimesUsed());
            Assert.Greater(assets[0].GetLastAccessed(), 0);
            Assert.Greater(assets[0].GetFirstAccessed(), 0);
            Assert.AreEqual(assets[0].GetLastAccessed(), assets[0].GetFirstAccessed());

            dataManager.MarkAssetCompleted("ID0");
            Assert.AreEqual(2, assets[0].GetTimesUsed());
            Assert.GreaterOrEqual(assets[0].GetLastAccessed(), assets[0].GetFirstAccessed());
        }
Exemple #16
0
        public void AddMultipleAssetsToExistingList()
        {
            string groupId = "groupId";

            string []           assets = new string [] { "asset1" };
            AssetsDataManager   alm    = new AssetsDataManager();
            ProblemDataManager  plm    = new ProblemDataManager();
            GroupLinkageManager glm    = new GroupLinkageManager(alm, plm);

            glm.addAssets(groupId, assets);
            Assert.AreEqual(1, glm.getAssets(groupId).Count);

            assets = new string[] { "asset2", "asset3", "asset4" };
            glm.addAssets(groupId, assets);

            foreach (string asset in assets)
            {
                Assert.IsTrue(glm.getAssets(groupId).Contains(asset));
            }
            Assert.IsTrue(glm.getAssets(groupId).Contains("asset1"));
        }