File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
SG.CodeCoverage.Tests.NetFx Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,16 @@ public void ExitApp()
113
113
{
114
114
CheckAppStarted ( ) ;
115
115
_process . StandardInput . WriteLine ( "exit" ) ;
116
- if ( ! _process . WaitForExit ( 10000 ) )
117
- throw new Exception ( "App did not exit withing 10 seconds." ) ;
116
+ if ( ! _process . WaitForExit ( 20000 ) )
117
+ throw new Exception ( "App did not exit withing 20 seconds." ) ;
118
+ _process . WaitForExit ( ) ;
119
+ _process = null ;
120
+ }
121
+
122
+ public void KillApp ( )
123
+ {
124
+ CheckAppStarted ( ) ;
125
+ _process . Kill ( ) ;
118
126
_process . WaitForExit ( ) ;
119
127
_process = null ;
120
128
}
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public void Coverage_Startup()
26
26
{
27
27
_tester . RunApp ( ) ;
28
28
AssertVisitedFilesAndMethods ( Files . Startup , Methods . Startup ) ;
29
+ _tester . KillApp ( ) ;
29
30
}
30
31
31
32
[ TestMethod ]
@@ -38,6 +39,7 @@ public void Coverage_IsPrime1()
38
39
Methods . Startup
39
40
. Concat ( Methods . RunCommand )
40
41
. Concat ( Methods . PrimeCalculator . IsPrimeAndIsLessThan2 ) ) ;
42
+ _tester . KillApp ( ) ;
41
43
}
42
44
43
45
[ TestMethod ]
@@ -51,6 +53,7 @@ public void Coverage_IsPrime4()
51
53
. Concat ( Methods . RunCommand )
52
54
. Concat ( Methods . PrimeCalculator . IsPrimeAndIsLessThan2 )
53
55
. Concat ( Methods . PrimeCalculator . GetUpperBound ) ) ;
56
+ _tester . KillApp ( ) ;
54
57
}
55
58
56
59
[ TestMethod ]
@@ -66,6 +69,7 @@ public void Coverage_IsPrime7()
66
69
. Concat ( Methods . PrimeCalculator . IsPrimeAndIsLessThan2 )
67
70
. Concat ( Methods . PrimeCalculator . GetUpperBound )
68
71
. Concat ( Methods . SampleStruct ) ) ;
72
+ _tester . KillApp ( ) ;
69
73
}
70
74
71
75
[ TestMethod ]
@@ -80,6 +84,7 @@ public void Coverage_ResetHits_IsPrime2()
80
84
Methods . RunCommand
81
85
. Concat ( Methods . PrimeCalculator . IsPrimeAndIsLessThan2 )
82
86
. Append ( Methods . get_Commands ) ) ;
87
+ _tester . KillApp ( ) ;
83
88
}
84
89
85
90
[ TestMethod ]
You can’t perform that action at this time.
0 commit comments