public TreeTestDomain Add(string testFilePath)
        {
            if (testFilePath == null)
            {
                throw new ArgumentNullException("testFilePath");
            }
            if (!File.Exists(testFilePath))
            {
                throw new FileNotFoundException("File not found", testFilePath);
            }
            // check if already in collection
            if (this.ContainsTestAssembly(testFilePath))
            {
                throw new ArgumentException("File " + testFilePath + " already loaded");
            }

            TreeTestDomain domain = new TreeTestDomain(testFilePath, this.factory);

            domain.ShadowCopyFiles = true;

            this.identifierDomains.Add(domain.Identifier, domain);
            this.list.Add(domain);
            this.watcher.Add(testFilePath);

            return(domain);
        }
 public bool Contains(TreeTestDomain domain)
 {
     if (domain == null)
     {
         throw new ArgumentNullException("domain");
     }
     return(this.list.Contains(domain));
 }
        protected TreeTestDomain GetDomain(Guid identifier)
        {
            TreeTestDomain domain = this.identifierDomains[identifier] as TreeTestDomain;

            if (domain == null)
            {
                throw new InvalidOperationException("Could not find domain");
            }
            return(domain);
        }
        public ReportRun GetResult(UnitTreeNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            TreeTestDomain domain = this.GetDomain(node.DomainIdentifier);

            return(domain.TestTree.GetResult(node.TestIdentifier));
        }
        public void Remove(TreeTestDomain testDomain)
        {
            if (testDomain == null)
            {
                throw new ArgumentNullException("testDomain");
            }

            testDomain.Unload();
            this.identifierDomains.Remove(testDomain.Identifier);
            this.watcher.Remove(testDomain.TestFilePath);
            this.list.Remove(testDomain);

            testDomain.Dispose();
        }
        public void RunPipes(UnitTreeNode node)
        {
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            try
            {
                this.Watcher.Stop();
                TreeTestDomain domain = GetDomain(node.DomainIdentifier);
                domain.TestTree.RunPipes(node);
            }
            finally
            {
                this.Watcher.Start();
            }
        }
		public TreeTestDomain Add(string testFilePath)
		{
			if (testFilePath==null)
				throw new ArgumentNullException("testFilePath");
			if (!File.Exists(testFilePath))
				throw new FileNotFoundException("File not found",testFilePath);
			// check if already in collection
			if (this.ContainsTestAssembly(testFilePath))
				throw new ArgumentException("File "+testFilePath+" already loaded");

			TreeTestDomain domain = new TreeTestDomain(testFilePath,this.factory);
            domain.ShadowCopyFiles = true;

            this.identifierDomains.Add(domain.Identifier, domain);
			this.list.Add(domain);
			this.watcher.Add(testFilePath);

			return domain;
		}
        public void Remove(TreeTestDomain testDomain)
        {
            if (testDomain==null)
                throw new ArgumentNullException("testDomain");

            testDomain.Unload();
            this.identifierDomains.Remove(testDomain.Identifier);
            this.watcher.Remove(testDomain.TestFilePath);
            this.list.Remove(testDomain);

            testDomain.Dispose();
        }
 public bool Contains(TreeTestDomain domain)
 {
     if (domain==null)
         throw new ArgumentNullException("domain");
     return this.list.Contains(domain);
 }