예제 #1
0
        public void GetFactorTreesByIdsAndSearchCriteria_UserCanReadOnlyPublicFactors_GetNonPublicFactor_ExpectsNoFactorTree()
        {
            SetUserAndApplicationIdentifier("testUserPublic", ApplicationIdentifier.EVA.ToString());

            List <Int32>                factorIds = new List <Int32>();
            List <WebFactorTreeNode>    factorTrees;
            WebFactorTreeSearchCriteria searchCriteria = new WebFactorTreeSearchCriteria();

            factorIds.Add(1872);

            searchCriteria.FactorIds = factorIds;
            factorTrees = FactorManager.GetFactorTreesBySearchCriteria(GetContext(), searchCriteria);
            Assert.IsNotNull(factorTrees);
            Assert.IsTrue(factorTrees.IsEmpty());
            Console.WriteLine("factorTrees.Count: " + factorTrees.Count);
            Assert.AreEqual(factorTrees.Count, 0);
        }
예제 #2
0
        public void GetFactorTreesByIdsAndSearchCriteria_UserCanReadAllFactors_GetNonPublicFactor_ExpectsFactorTree()
        {
            List <Int32>                factorIds = new List <Int32>();
            List <WebFactorTreeNode>    factorTrees;
            WebFactorTreeSearchCriteria searchCriteria = new WebFactorTreeSearchCriteria();

            factorIds.Add(1872);

            searchCriteria.FactorIds = factorIds;
            factorTrees = FactorManager.GetFactorTreesBySearchCriteria(GetContext(), searchCriteria);
            Assert.IsNotNull(factorTrees);
            Assert.IsTrue(factorTrees.IsNotEmpty());
            Console.WriteLine("factorTrees.Count: " + factorTrees.Count);
            Assert.AreEqual(factorTrees.Count, 1);
            Console.WriteLine("factorTrees[0].Children.Count: " + factorTrees[0].Children.Count);
            Assert.AreEqual(factorTrees[0].Children.Count, 4);
        }
예제 #3
0
        public void GetFactorTreesByIdsAndSearchCriteria()
        {
            List <Int32>                factorIds = new List <Int32>();
            List <WebFactorTreeNode>    factorTrees;
            WebFactorTreeSearchCriteria searchCriteria = new WebFactorTreeSearchCriteria();

            factorIds.Add(661);

            searchCriteria.FactorIds = factorIds;
            factorTrees = FactorManager.GetFactorTreesBySearchCriteria(GetContext(), searchCriteria);
            Assert.IsNotNull(factorTrees);
            Assert.IsTrue(factorTrees.IsNotEmpty());

            searchCriteria.FactorIds = factorIds;
            factorTrees = FactorManager.GetFactorTreesBySearchCriteria(GetContext(), searchCriteria);
            Assert.IsNotNull(factorTrees);
            Assert.AreEqual(factorTrees.Count, 1);
            Assert.AreEqual(factorTrees[0].Children.Count, 9);
        }