Esempio n. 1
0
        public void ResolveIncludes(ISuite rootSuite, Hashtable lookupTable, NotifyEventDelegate onErrorIncluding)
        {
            foreach (ITestNode testNode in lookupTable.Values)
            {
                if (!testNode.IsRunnable)
                {
                    continue;
                }
                foreach (ITestNode childNode in testNode)
                {
                    var linkNode = childNode as ITestLink;
                    if (linkNode != null)
                    {
                        string searchNodeName = linkNode.ContentText;
                        searchNodeName = searchNodeName.Replace("/", "\\");
                        if (searchNodeName.ToLower().Contains("!include"))
                        {
                            searchNodeName = searchNodeName.Substring(9).Trim();
                        }
                        string rootSuitePath = rootSuite.Name + "\\";
                        if (searchNodeName.StartsWith("."))
                        {
                            searchNodeName = searchNodeName.Replace(".\\", rootSuitePath);
                        }
                        else
                        {
                            if (!searchNodeName.ToLower().StartsWith(rootSuitePath.ToLower()))
                            {
                                searchNodeName = rootSuitePath + searchNodeName;
                            }
                        }
                        searchNodeName = searchNodeName.Replace(".", "\\");
                        searchNodeName = searchNodeName.Replace("/", "\\");

                        var  includeNode          = lookupTable[searchNodeName.ToUpper()] as ITestNode;
                        bool containsRunnableNode = false;
                        ContainsRunnableItems(includeNode, ref containsRunnableNode);
                        if ((includeNode != null) && (!includeNode.IsRunnable) && (!containsRunnableNode))
                        {
                            linkNode.AddChildNode(includeNode);
                        }
                        else if (onErrorIncluding != null)
                        {
                            onErrorIncluding(linkNode);
                        }
                    }
                }
            }
        }
Esempio n. 2
0
 public void RemoveObserver(NotifyEventDelegate ob)
 {
     NotifyEventHandler -= ob;
 }
Esempio n. 3
0
 // maintain the observers list
 public void AddObserver(NotifyEventDelegate ob)
 {
     NotifyEventHandler += ob;
 }