Beispiel #1
0
        public static bool CompareTree(UITestNode rootTestOriginal, UITestNode rootTestNew)
        {
            if (!AreNodesTheSame(rootTestOriginal, rootTestNew))
            {
                return(false);
            }

            if (rootTestOriginal.IsSuite && rootTestNew.IsSuite)
            {
                if (rootTestOriginal.Tests.Count != rootTestNew.Tests.Count)
                {
                    return(false);
                }

                for (int i = 0; i < rootTestOriginal.Tests.Count; i++)
                {
                    if (!CompareTree((UITestNode)rootTestOriginal.Tests[i], (UITestNode)rootTestNew.Tests[i]))
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Beispiel #2
0
		private static bool AreNodesTheSame( UITestNode testOne, UITestNode testTwo )
		{
			if( testOne == null && testTwo != null ) return false;
			if( testTwo == null && testOne != null ) return false;
			if( testOne.IsSuite != testTwo.IsSuite ) return false;
			if( testOne.ShouldRun != testTwo.ShouldRun ) return false;

			return testOne.FullName.Equals(testTwo.FullName);
		}
Beispiel #3
0
        /// <summary>
        /// Populate the arraylist of child Tests recursively.
        /// If already populated, it has no effect.
        /// </summary>
        public void PopulateTests()
        {
            if (!Populated)
            {
                foreach (ITest test in testSuite.Tests)
                {
                    UITestNode node = new UITestNode(test, true);
                    tests.Add(node);
                    testCaseCount += node.CountTestCases();
                }

                testSuite = null;
            }
        }
Beispiel #4
0
		public static bool CompareTree( UITestNode rootTestOriginal, UITestNode rootTestNew )
		{
			if( !AreNodesTheSame( rootTestOriginal, rootTestNew ) ) 
				return false;

			if( rootTestOriginal.IsSuite && rootTestNew.IsSuite )
			{
				if( rootTestOriginal.Tests.Count != rootTestNew.Tests.Count )
					return false;

				for(int i=0; i< rootTestOriginal.Tests.Count; i++)
					if( !CompareTree( (UITestNode)rootTestOriginal.Tests[i], (UITestNode)rootTestNew.Tests[i] ) ) 
						return false;
			}

			return true;
		}
Beispiel #5
0
        private static bool AreNodesTheSame(UITestNode testOne, UITestNode testTwo)
        {
            if (testOne == null && testTwo != null)
            {
                return(false);
            }
            if (testTwo == null && testOne != null)
            {
                return(false);
            }
            if (testOne.IsSuite != testTwo.IsSuite)
            {
                return(false);
            }
            if (testOne.ShouldRun != testTwo.ShouldRun)
            {
                return(false);
            }

            return(testOne.FullName.Equals(testTwo.FullName));
        }
Beispiel #6
0
		/// <summary>
		/// Populate the arraylist of child Tests recursively.
		/// If already populated, it has no effect.
		/// </summary>
		public void PopulateTests()
		{
			if ( !Populated )
			{
				foreach( ITest test in testSuite.Tests )
				{
					UITestNode node = new UITestNode( test, true );
					tests.Add( node );
					testCaseCount += node.CountTestCases();
				}

				testSuite = null;
			}
		}