Пример #1
0
        private void TestUnresolvedReferencesHelper(ArrayList projectRefs, Hashtable pregenConfigurations,
                                                    out Hashtable unresolvedProjects, out Hashtable resolvedProjects)
        {
            // Use the XML string generation method from our sister class - XML element names will be different,
            // but they are ignored anyway, and the rest is identical
            string xmlString = ResolveNonMSBuildProjectOutput_Tests.CreatePregeneratedPathDoc(pregenConfigurations);

            MockEngine engine = new MockEngine(_output);
            AssignProjectConfiguration rpc = new AssignProjectConfiguration();

            rpc.BuildEngine = engine;
            rpc.SolutionConfigurationContents = xmlString;
            rpc.ProjectReferences             = (ITaskItem[])projectRefs.ToArray(typeof(ITaskItem));

            bool result = rpc.Execute();

            unresolvedProjects = new Hashtable();

            for (int i = 0; i < rpc.UnassignedProjects.Length; i++)
            {
                unresolvedProjects[rpc.UnassignedProjects[i].ItemSpec] = rpc.UnassignedProjects[i];
            }

            resolvedProjects = new Hashtable();
            for (int i = 0; i < rpc.AssignedProjects.Length; i++)
            {
                resolvedProjects[rpc.AssignedProjects[i].GetMetadata("FullConfiguration")] = rpc.AssignedProjects[i];
            }
        }