[Adapdev-commits] Adapdev/src/Adapdev.UnitTest.Core AbstractTest.cs,1.2,1.3 AbstractTestResult.cs,1.
Status: Beta
Brought to you by:
intesar66
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31410/src/Adapdev.UnitTest.Core Modified Files: AbstractTest.cs AbstractTestResult.cs TestAssembly.cs TestFixture.cs TestRunner.cs TestState.cs TestSuiteBuilder.cs Log Message: Fixed several bugs with SmartTreeView Fixed bugs with TestRunner Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestSuiteBuilder.cs 27 Apr 2005 04:36:02 -0000 1.4 --- TestSuiteBuilder.cs 5 Jun 2005 08:50:32 -0000 1.5 *************** *** 104,112 **** ta.AssemblyName = fi.Name; ta.AssemblyFullName = assembly.FullName; ta.Name = assembly.GetName().Name; ta.Path = assembly.Location; ta.Location = fi.DirectoryName; ta.OriginalPath = assemblyName; - ta.Id = id++; // Build the TestFixtures --- 104,112 ---- ta.AssemblyName = fi.Name; ta.AssemblyFullName = assembly.FullName; + ta.FullName = assembly.GetName().Name; ta.Name = assembly.GetName().Name; ta.Path = assembly.Location; ta.Location = fi.DirectoryName; ta.OriginalPath = assemblyName; // Build the TestFixtures *************** *** 144,148 **** tf.Namespace = t.Namespace; tf.FullName = t.FullName; - tf.Id = id++; this.ProcessCommonAttributes(t, tf); --- 144,147 ---- *************** *** 203,207 **** t.Name = m.Name; t.FullName = tf.FullName + "." + m.Name; - t.Id = id++; this.ProcessTestAttribute(m, t); this.ProcessCommonAttributes(m, t); --- 202,205 ---- Index: TestFixture.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestFixture.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestFixture.cs 27 Apr 2005 04:36:02 -0000 1.2 --- TestFixture.cs 5 Jun 2005 08:50:32 -0000 1.3 *************** *** 163,167 **** foreach (Test t in this.GetTests()) { ! if(t.ShouldRun) { count += t.GetTestCount(); --- 163,167 ---- foreach (Test t in this.GetTests()) { ! if(t.ShouldRun && !t.Ignore) { count += t.GetTestCount(); Index: AbstractTest.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/AbstractTest.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractTest.cs 14 Apr 2005 03:32:05 -0000 1.2 --- AbstractTest.cs 5 Jun 2005 08:50:31 -0000 1.3 *************** *** 48,53 **** protected string _ignoreReason = ""; protected int _sequence = 0; - protected bool _threads = false; protected int _id = 0; protected bool _repeat = false; protected int _repeatCount = 1; --- 48,53 ---- protected string _ignoreReason = ""; protected int _sequence = 0; protected int _id = 0; + protected bool _threads = false; protected bool _repeat = false; protected int _repeatCount = 1; *************** *** 59,65 **** --- 59,67 ---- protected AbstractTestResult _result = null; protected string _fullName = String.Empty; + private static int _globalid = 0; public AbstractTest() { + this._id = System.Threading.Interlocked.Increment(ref _globalid); } Index: TestAssembly.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestAssembly.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestAssembly.cs 27 Apr 2005 04:36:02 -0000 1.2 --- TestAssembly.cs 5 Jun 2005 08:50:32 -0000 1.3 *************** *** 128,132 **** foreach (TestFixture t in this.GetTestFixtures()) { ! if(t.ShouldRun) { count += t.GetTestCount(); --- 128,132 ---- foreach (TestFixture t in this.GetTestFixtures()) { ! if(t.ShouldRun && !t.Ignore) { count += t.GetTestCount(); Index: TestRunner.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestRunner.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestRunner.cs 27 Apr 2005 04:52:33 -0000 1.4 --- TestRunner.cs 5 Jun 2005 08:50:32 -0000 1.5 *************** *** 292,295 **** --- 292,300 ---- } } + else + { + ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; + ti.State = TestState.Pass; + } } else *************** *** 307,311 **** { ti.Result = e.InnerException.Message; ! ti.State = TestState.Ignore; ti.ExceptionType = e.InnerException.GetType().FullName; ti.FullStackTrace = e.InnerException.StackTrace; --- 312,316 ---- { ti.Result = e.InnerException.Message; ! ti.State = TestState.ForcedIgnore; ti.ExceptionType = e.InnerException.GetType().FullName; ti.FullStackTrace = e.InnerException.StackTrace; Index: TestState.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestState.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestState.cs 28 Feb 2005 01:32:22 -0000 1.1.1.1 --- TestState.cs 5 Jun 2005 08:50:32 -0000 1.2 *************** *** 49,53 **** Pass = 4, Ignore = 8, ! Fail = 16 } } \ No newline at end of file --- 49,54 ---- Pass = 4, Ignore = 8, ! Fail = 16, ! ForcedIgnore = 32 } } \ No newline at end of file Index: AbstractTestResult.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/AbstractTestResult.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractTestResult.cs 28 Feb 2005 01:32:20 -0000 1.1.1.1 --- AbstractTestResult.cs 5 Jun 2005 08:50:32 -0000 1.2 *************** *** 91,99 **** this._state = TestState.Fail; } ! else if (this.State != TestState.Fail && ti.State != TestState.Ignore) { this._state = TestState.Pass; } ! else if (this.State != TestState.Fail && this.State != TestState.Pass && ti.State == TestState.Ignore) { this._state = TestState.Ignore; --- 91,99 ---- this._state = TestState.Fail; } ! else if (this.State != TestState.Fail && ti.State != TestState.Ignore && ti.State != TestState.ForcedIgnore) { this._state = TestState.Pass; } ! else if (this.State != TestState.Fail && this.State != TestState.Pass && (ti.State == TestState.Ignore || ti.State == TestState.ForcedIgnore)) { this._state = TestState.Ignore; |