55
66namespace utPLSQL
77{
8+ /// <summary>
9+ /// Abstract base class for all TestRunner implementations
10+ /// </summary>
11+ /// <typeparam name="T">Type of result class used in callback action</typeparam>
812 public abstract class TestRunner < T >
913 {
10- public const string User = "USER" ;
11- public const string Package = "PACKAGE" ;
12- public const string Procedure = "PROCEDURE" ;
13- public const string All = "_ALL" ;
14-
1514 internal OracleConnection produceConnection ;
1615 internal OracleConnection consumeConnection ;
1716
1817 protected string realtimeReporterId ;
1918 protected string coverageReporterId ;
2019
20+ /// <summary>
21+ /// Connects to the database.
22+ /// The TestRunner uses two connections. One for executing the tests and one for consuming the reuslts
23+ /// </summary>
24+ /// <param name="username">Database username</param>
25+ /// <param name="password">Database password</param>
26+ /// <param name="database">Database name</param>
2127 public void Connect ( string username , string password , string database )
2228 {
2329 var connectionString = $ "User Id={ username } ;Password={ password } ;Data Source={ database } ";
@@ -28,13 +34,19 @@ public void Connect(string username, string password, string database)
2834 consumeConnection = new OracleConnection ( connectionString ) ;
2935 consumeConnection . Open ( ) ;
3036 }
31-
37+ /// <summary>
38+ /// Closes both connections
39+ /// </summary>
3240 public void Close ( )
3341 {
3442 produceConnection ? . Close ( ) ;
3543 consumeConnection ? . Close ( ) ;
3644 }
3745
46+ /// <summary>
47+ /// Returns the installed utPLSQL version
48+ /// </summary>
49+ /// <returns>Version as string</returns>
3850 public String GetVersion ( )
3951 {
4052 var cmd = new OracleCommand ( "select ut.version() from dual" , produceConnection ) ;
@@ -45,13 +57,38 @@ public String GetVersion()
4557 return version ;
4658 }
4759
48- public abstract void RunTests ( string type , string owner , string name , string procedure ) ;
49-
50- public abstract void RunTestsWithCoverage ( string type , string owner , string name , string procedure , string coverageSchemas ,
60+ /// <summary>
61+ /// Run tests
62+ /// </summary>
63+ /// <param name="type">The type to use</param>
64+ /// <param name="owner">Owner of the object</param>
65+ /// <param name="name">Name of the object</param>
66+ /// <param name="procedure">Procedure name</param>
67+ public abstract void RunTests ( Type type , string owner , string name , string procedure ) ;
68+
69+ /// <summary>
70+ /// Run tests with coveage
71+ /// </summary>
72+ /// <param name="type">The type to use</param>
73+ /// <param name="owner">Owner of the object</param>
74+ /// <param name="name">Name of the object</param>
75+ /// <param name="procedure">Procedure name</param>
76+ /// <param name="coverageSchemas">Schemas to cover</param>
77+ /// <param name="includeObjects">Objects to include</param>
78+ /// <param name="excludeObjects">Objects to exclude</param>
79+ public abstract void RunTestsWithCoverage ( Type type , string owner , string name , string procedure , string coverageSchemas ,
5180 string includeObjects , string excludeObjects ) ;
5281
82+ /// <summary>
83+ /// Consumes the results and calls the callback action on each result
84+ /// </summary>
85+ /// <param name="consumer">Typed action that will get the results</param>
5386 public abstract void ConsumeResult ( Action < T > consumer ) ;
5487
88+ /// <summary>
89+ /// Returns the HTML coverage report
90+ /// </summary>
91+ /// <returns>HTML coverage report</returns>
5592 public string GetCoverageReport ( )
5693 {
5794 var sb = new StringBuilder ( ) ;
@@ -83,4 +120,8 @@ public string GetCoverageReport()
83120 return sb . ToString ( ) ;
84121 }
85122 }
123+ public enum Type
124+ {
125+ User , Package , Procedure , All
126+ }
86127}
0 commit comments