Esempio n. 1
0
        public void ConvertToTaskItems()
        {
            resultWithOutputs.ConvertToTaskItems();
            Assert.AreEqual(1, resultWithOutputs.OutputsByTarget.Count, "Expected Number of Item arrays to be 1");
            string[] keys = new string[resultWithOutputs.OutputsByTarget.Count];
            resultWithOutputs.OutputsByTarget.Keys.CopyTo(keys, 0);
            TaskItem[] taskItems       = (TaskItem[])resultWithOutputs.OutputsByTarget[keys[0]];
            bool       foundFirstItem  = false;
            bool       foundSecondItem = false;

            foreach (TaskItem taskItem in taskItems)
            {
                if ((taskItem.item.IsUninitializedItem) && (string.Compare(taskItem.item.FinalItemSpec, "TestInclude1", StringComparison.OrdinalIgnoreCase) == 0))
                {
                    foundFirstItem = true;
                }
                else if ((string.Compare(taskItem.item.Name, "BuildItem2", StringComparison.OrdinalIgnoreCase) == 0) && (string.Compare(taskItem.item.FinalItemSpec, "TestInclude2", StringComparison.OrdinalIgnoreCase) == 0))
                {
                    foundSecondItem = true;
                }
            }
            Assert.IsTrue(foundFirstItem && foundSecondItem, "Expected to find both items converted to taskItems");
        }