5
5
6
6
namespace utPLSQL
7
7
{
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>
8
12
public abstract class TestRunner < T >
9
13
{
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
-
15
14
internal OracleConnection produceConnection ;
16
15
internal OracleConnection consumeConnection ;
17
16
18
17
protected string realtimeReporterId ;
19
18
protected string coverageReporterId ;
20
19
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>
21
27
public void Connect ( string username , string password , string database )
22
28
{
23
29
var connectionString = $ "User Id={ username } ;Password={ password } ;Data Source={ database } ";
@@ -28,13 +34,19 @@ public void Connect(string username, string password, string database)
28
34
consumeConnection = new OracleConnection ( connectionString ) ;
29
35
consumeConnection . Open ( ) ;
30
36
}
31
-
37
+ /// <summary>
38
+ /// Closes both connections
39
+ /// </summary>
32
40
public void Close ( )
33
41
{
34
42
produceConnection ? . Close ( ) ;
35
43
consumeConnection ? . Close ( ) ;
36
44
}
37
45
46
+ /// <summary>
47
+ /// Returns the installed utPLSQL version
48
+ /// </summary>
49
+ /// <returns>Version as string</returns>
38
50
public String GetVersion ( )
39
51
{
40
52
var cmd = new OracleCommand ( "select ut.version() from dual" , produceConnection ) ;
@@ -45,13 +57,38 @@ public String GetVersion()
45
57
return version ;
46
58
}
47
59
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 ,
51
80
string includeObjects , string excludeObjects ) ;
52
81
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>
53
86
public abstract void ConsumeResult ( Action < T > consumer ) ;
54
87
88
+ /// <summary>
89
+ /// Returns the HTML coverage report
90
+ /// </summary>
91
+ /// <returns>HTML coverage report</returns>
55
92
public string GetCoverageReport ( )
56
93
{
57
94
var sb = new StringBuilder ( ) ;
@@ -83,4 +120,8 @@ public string GetCoverageReport()
83
120
return sb . ToString ( ) ;
84
121
}
85
122
}
123
+ public enum Type
124
+ {
125
+ User , Package , Procedure , All
126
+ }
86
127
}
0 commit comments