Ejemplo n.º 1
0
 public void SuiteReturningTypes()
 {
     TestSuite suite = new LegacySuite(typeof(LegacySuiteReturningTypes));
     Assert.AreEqual(RunState.Runnable, suite.RunState);
     Assert.AreEqual(3, suite.Tests.Count);
     Assert.AreEqual(11, suite.TestCount);
 }
Ejemplo n.º 2
0
 //        [Test]
 public void SetUpAndTearDownAreCalled()
 {
     TestSuite suite = new LegacySuite( typeof( LegacySuiteWithSetUpAndTearDown ) );
     suite.Run( NullListener.NULL );
     LegacySuiteWithSetUpAndTearDown fixture = (LegacySuiteWithSetUpAndTearDown)suite.Fixture;
     Assert.AreEqual( 1, fixture.setupCount );
     Assert.AreEqual( 1, fixture.teardownCount );
 }
Ejemplo n.º 3
0
 public void SetUpAndTearDownAreCalled()
 {
     setupCount = teardownCount = 0;
     TestSuite suite = new LegacySuite( typeof( LegacySuiteWithSetUpAndTearDown ) );
     Assert.AreEqual(RunState.Runnable, suite.RunState);
     suite.Run( NullListener.NULL );
     Assert.AreEqual( 1, setupCount );
     Assert.AreEqual( 1, teardownCount );
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Helper routine that makes a suite from either a TestFixture or
        /// a legacy Suite property.
        /// </summary>
        /// <param name="testType"></param>
        /// <returns></returns>
        private TestSuite MakeSuite(Type testType)
        {
            TestSuite suite = null;

            if (testType != null)
            {
                if (TestFixture.IsValidType(testType))
                {
                    suite = new TestFixture(testType);
                }
                else if (LegacySuite.IsValidType(testType))
                {
                    suite = new LegacySuite(testType);
                }
            }

            return(suite);
        }
Ejemplo n.º 5
0
		/// <summary>
		/// Helper routine that makes a suite from either a TestFixture or
		/// a legacy Suite property.
		/// </summary>
		/// <param name="testType"></param>
		/// <returns></returns>
		private TestSuite MakeSuite( Type testType )
		{
			TestSuite suite = null;

			if(testType != null)
			{
				if( TestFixture.IsValidType( testType ) )
				{
					suite = new TestFixture( testType );
				}
				else if( LegacySuite.IsValidType( testType ) )
				{
					suite = new LegacySuite( testType );
				}
			}
			
			return suite;
		}
Ejemplo n.º 6
0
 public void SuitePropertyWithInvalidType()
 {
     TestSuite suite = new LegacySuite(typeof(LegacySuiteWithInvalidPropertyType));
     Assert.AreEqual(RunState.NotRunnable, suite.RunState);
 }