Пример #1
0
        public void TestGetDependents( )
        {
            long coreSolutionId = Entity.GetIdFromUpgradeId(_coreUpgradeId);

            var applicationDependents = SolutionHelper.GetApplicationDependents(coreSolutionId);

            Assert.IsTrue(applicationDependents.Count > 0, "No application dependents found");
        }
Пример #2
0
        public HttpResponseMessage GetDependents(long vid)
        {
            IEnumerable <Solution> solutions = SolutionHelper.GetApplicationDependents(vid).Select(ad => ad.DependentApplication);

            List <DependentAppData> data = new List <DependentAppData>( );

            foreach (Solution solution in solutions)
            {
                data.Add(new DependentAppData(solution.Id, solution.Name, solution.SolutionVersionString));
            }

            var response = new HttpResponseMessage <IList <DependentAppData> >(data, HttpStatusCode.OK);

            return(response);
        }
Пример #3
0
        public void TestGetApplicationDependents(long applicationId, bool immediateOnly, int minExpectedCount = 0, IEnumerable <Guid> minExpectedResults = null)
        {
            IList <ApplicationDependency> results = SolutionHelper.GetApplicationDependents(applicationId, immediateOnly);

            Assert.IsNotNull(results);
            Assert.GreaterOrEqual(results.Count, minExpectedCount);

            if (minExpectedResults != null)
            {
                List <Guid> dependents = results.Select(r => Entity.GetUpgradeId(r.DependentApplication.Id)).ToList( );

                foreach (Guid expectedResult in minExpectedResults)
                {
                    Assert.Contains(expectedResult, dependents);
                }
            }
        }