@@ -207,7 +207,7 @@ public static void OnMenuClick(int index)
207
207
{
208
208
if ( index == PluginMenuIndexAllTests )
209
209
{
210
- if ( connected ( ) && ! Sydba ( ) )
210
+ if ( isConnected ( ) && ! isSydba ( ) )
211
211
{
212
212
var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database , connectAs ) ;
213
213
Windows . Add ( testResultWindow ) ;
@@ -216,7 +216,7 @@ public static void OnMenuClick(int index)
216
216
}
217
217
else if ( index == PluginMenuIndexAllTestsWithCoverage )
218
218
{
219
- if ( connected ( ) && ! Sydba ( ) )
219
+ if ( isConnected ( ) && ! isSydba ( ) )
220
220
{
221
221
var testResultWindow = new TestRunnerWindow ( _plugin , username , password , database , connectAs ) ;
222
222
Windows . Add ( testResultWindow ) ;
@@ -225,7 +225,7 @@ public static void OnMenuClick(int index)
225
225
}
226
226
else if ( index == PluginPopupIndex )
227
227
{
228
- if ( connected ( ) && ! Sydba ( ) )
228
+ if ( isConnected ( ) && ! isSydba ( ) )
229
229
{
230
230
getPopupObject ( out IntPtr type , out IntPtr owner , out IntPtr name , out IntPtr subType ) ;
231
231
@@ -237,7 +237,7 @@ public static void OnMenuClick(int index)
237
237
}
238
238
else if ( index == PluginPopupIndexWithCoverage )
239
239
{
240
- if ( connected ( ) && ! Sydba ( ) )
240
+ if ( isConnected ( ) && ! isSydba ( ) )
241
241
{
242
242
getPopupObject ( out IntPtr type , out IntPtr owner , out IntPtr name , out IntPtr subType ) ;
243
243
@@ -263,7 +263,7 @@ public void OpenPackageBody(string owner, string name)
263
263
var source = getObjectSource ( "PACKAGE BODY" , owner , name ) ;
264
264
createWindow ( 3 , Marshal . PtrToStringAnsi ( source ) , false ) ;
265
265
}
266
- private static bool Sydba ( )
266
+ private static bool isSydba ( )
267
267
{
268
268
if ( connectAs . ToLower ( ) . Equals ( "sysdba" ) ) {
269
269
MessageBox . Show ( "You shouldn't run utPLSQL as SYSDBA.\n \n Test will not run." , "Connected as SYSDBA" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
@@ -272,7 +272,17 @@ private static bool Sydba()
272
272
return false ;
273
273
}
274
274
275
- private static void ConnectToDatabase ( )
275
+ private static bool isConnected ( )
276
+ {
277
+ if ( ! connected ( ) )
278
+ {
279
+ MessageBox . Show ( "Please connect before running tests!" , "No connection" , MessageBoxButtons . OK , MessageBoxIcon . Error ) ;
280
+ return false ;
281
+ }
282
+ return true ;
283
+ }
284
+
285
+ private static void ConnectToDatabase ( )
276
286
{
277
287
try
278
288
{
0 commit comments