Exemple #1
0
        public void NullGroupId()
        {
            AssetsDataManager   alm = new AssetsDataManager();
            ProblemDataManager  plm = new ProblemDataManager();
            GroupLinkageManager glm = new GroupLinkageManager(alm, plm);

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

            Assert.IsNotNull(glm);
        }
Exemple #3
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 #4
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 #5
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 #6
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 #7
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 #8
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"));
        }