[Adapdev-commits] Adapdev/src/Adapdev.UnitTest.Core Test.cs,1.1.1.1,1.2 TestAssembly.cs,1.1.1.1,1.2
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-04-27 04:36:13
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385/src/Adapdev.UnitTest.Core Modified Files: Test.cs TestAssembly.cs TestFixture.cs TestRunner.cs TestSuiteBuilder.cs Log Message: Added stored procedure parameter lengths for appropriate types for Codus Added external config file support for Zanebug Added ExpectedException message support Index: TestSuiteBuilder.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestSuiteBuilder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TestSuiteBuilder.cs 23 Apr 2005 04:54:13 -0000 1.3 --- TestSuiteBuilder.cs 27 Apr 2005 04:36:02 -0000 1.4 *************** *** 300,303 **** --- 300,304 ---- t.ExpectedExceptionType = a.ExceptionType; + t.ExpectedExceptionMessage = a.Message; } else if (TypeHelper.HasCustomAttribute(m, typeof (NUnit.Framework.ExpectedExceptionAttribute))) *************** *** 307,310 **** --- 308,312 ---- t.ExpectedExceptionType = a.ExceptionType.FullName; + t.ExpectedExceptionMessage = a.ExpectedMessage; } return; Index: TestAssembly.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestAssembly.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestAssembly.cs 28 Feb 2005 01:32:21 -0000 1.1.1.1 --- TestAssembly.cs 27 Apr 2005 04:36:02 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- protected string _location = String.Empty; protected string _original = String.Empty; + protected string _configFile = String.Empty; public TestAssembly() *************** *** 63,66 **** --- 64,73 ---- } + public string ConfigFile + { + get { return _configFile; } + set { _configFile = value; } + } + public string Path { *************** *** 121,125 **** foreach (TestFixture t in this.GetTestFixtures()) { ! count += t.GetTestCount(); } return count*this.RepeatCount; --- 128,135 ---- foreach (TestFixture t in this.GetTestFixtures()) { ! if(t.ShouldRun) ! { ! count += t.GetTestCount(); ! } } return count*this.RepeatCount; Index: TestFixture.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestFixture.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TestFixture.cs 28 Feb 2005 01:32:22 -0000 1.1.1.1 --- TestFixture.cs 27 Apr 2005 04:36:02 -0000 1.2 *************** *** 163,167 **** foreach (Test t in this.GetTests()) { ! count += t.GetTestCount(); } return count*this.RepeatCount; --- 163,170 ---- foreach (Test t in this.GetTests()) { ! if(t.ShouldRun) ! { ! count += t.GetTestCount(); ! } } return count*this.RepeatCount; Index: Test.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/Test.cs,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Test.cs 28 Feb 2005 01:32:21 -0000 1.1.1.1 --- Test.cs 27 Apr 2005 04:36:02 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- protected string _category = ""; protected string _exceptionType = null; + protected string _exceptionMessage = null; protected TestFixture _parent = null; *************** *** 70,73 **** --- 71,80 ---- } + public string ExpectedExceptionMessage + { + get{return this._exceptionMessage;} + set{this._exceptionMessage = value;} + } + public bool IsFixtureSetUp { Index: TestRunner.cs =================================================================== RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core/TestRunner.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestRunner.cs 14 Apr 2005 03:32:05 -0000 1.2 --- TestRunner.cs 27 Apr 2005 04:36:02 -0000 1.3 *************** *** 133,137 **** tar.Location = ta.Location; ! // if(this._debugMode) log.Debug("Running TA " + ta.Name); if(_dispatcher != null) _dispatcher.OnTestAssemblyStarted(new TestAssemblyEventArgs(ta)); --- 133,137 ---- tar.Location = ta.Location; ! if(this._debugMode) log.Debug("Running TA " + ta.Name); if(_dispatcher != null) _dispatcher.OnTestAssemblyStarted(new TestAssemblyEventArgs(ta)); *************** *** 168,172 **** Assembly a = AssemblyCache.Get(tf.Parent.OriginalPath); ! // if(this._debugMode) log.Debug("Running TF " + tf.Name); if(_dispatcher != null)_dispatcher.OnTestFixtureStarted(new TestFixtureEventArgs(tf)); --- 168,172 ---- Assembly a = AssemblyCache.Get(tf.Parent.OriginalPath); ! if(this._debugMode) log.Debug("Running TF " + tf.Name); if(_dispatcher != null)_dispatcher.OnTestFixtureStarted(new TestFixtureEventArgs(tf)); *************** *** 189,193 **** tr.Description = test.Description; ! // if(this._debugMode) log.Debug("Running T " + test.Name); if (!test.Ignore && test.ShouldRun) --- 189,193 ---- tr.Description = test.Description; ! if(this._debugMode) log.Debug("Running T " + test.Name); if (!test.Ignore && test.ShouldRun) *************** *** 279,295 **** if (e.InnerException.GetType().IsSubclassOf(t) || e.InnerException.GetType() == t) { ! ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; ! ti.ExceptionType = e.InnerException.GetType().FullName; ! ti.FullStackTrace = e.InnerException.StackTrace; ! ti.State = TestState.Pass; ! ti.MemoryUsed = (kEnd - kStart)/1024; } else { ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was NOT thrown. Message: " + e.InnerException.Message; - ti.ExceptionType = e.InnerException.GetType().FullName; - ti.FullStackTrace = e.InnerException.StackTrace; ti.State = TestState.Fail; } } // TODO : Fix incrementing of tests in GUI when IgnoreException is thrown --- 279,305 ---- if (e.InnerException.GetType().IsSubclassOf(t) || e.InnerException.GetType() == t) { ! if(test.ExpectedExceptionMessage.Length > 0) ! { ! if(test.ExpectedExceptionMessage.ToLower() == e.InnerException.Message) ! { ! ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown. Message: " + e.InnerException.Message; ! ti.State = TestState.Pass; ! } ! else ! { ! ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was thrown, but wrong message. Message: " + e.InnerException.Message + " - Expected: " + test.ExpectedExceptionMessage; ! ti.State = TestState.Fail; ! } ! } } else { ti.Result = "Expected Exception: " + test.ExpectedExceptionType + " was NOT thrown. Message: " + e.InnerException.Message; ti.State = TestState.Fail; } + ti.ExceptionType = e.InnerException.GetType().FullName; + ti.FullStackTrace = e.InnerException.StackTrace; + ti.MemoryUsed = (kEnd - kStart)/1024; + } // TODO : Fix incrementing of tests in GUI when IgnoreException is thrown |