File tree Expand file tree Collapse file tree 4 files changed +14
-17
lines changed
QuickVsixTests/CSharpUtils
QuickVsix/CSharpUtils/Process Expand file tree Collapse file tree 4 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Diagnostics ;
1
+ using System . Diagnostics ;
3
2
4
3
namespace CSharpUtils
5
4
{
Original file line number Diff line number Diff line change 1
1
using CSharpUtils ;
2
2
using NUnit . Framework ;
3
- using System ;
4
- using System . Diagnostics . CodeAnalysis ;
5
3
6
4
[ TestFixture ]
7
5
public static class ProcessResultTests
@@ -35,8 +33,8 @@ public static void Duration_ReturnsEndTimeMinusStartTime()
35
33
[ Test ]
36
34
public static void Equals_ThrowsIfAnyFieldNotEqual_OtherwiseReturnsTrue ( )
37
35
{
38
- ProcessResult expected = TestRandom . ProcessResultWithExitCode ( TestRandom . Int ( ) ) ;
39
- ProcessResult actual = TestRandom . ProcessResultWithExitCode ( TestRandom . Int ( ) ) ;
36
+ ProcessResult expected = TestRandom . ProcessResultWithRandomExitCode ( ) ;
37
+ ProcessResult actual = TestRandom . ProcessResultWithRandomExitCode ( ) ;
40
38
Assert2 . EqualsThrowsInvalidCastExceptionWhenComparedWithANewObject ( expected ) ;
41
39
42
40
NUnitAsserter nunitAsserterMock = Mock . Strict < NUnitAsserter > ( ) ;
Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Collections . Generic ;
3
- using System . Collections . ObjectModel ;
1
+ using System . Collections . ObjectModel ;
4
2
using System . Diagnostics ;
5
3
using System . Diagnostics . CodeAnalysis ;
6
- using System . Linq ;
7
4
8
5
namespace CSharpUtils
9
6
{
@@ -192,6 +189,12 @@ public static string[] StringArray()
192
189
return randomStringArray ;
193
190
}
194
191
192
+ public static ProcessResult ProcessResultWithRandomExitCode ( )
193
+ {
194
+ int randomExitCode = TestRandom . Int ( ) ;
195
+ return TestableProcessResultWithExitCode ( randomExitCode , RandomGenerator . Instance ) ;
196
+ }
197
+
195
198
public static ProcessResult ProcessResultWithExitCode ( int exitCode )
196
199
{
197
200
return TestableProcessResultWithExitCode ( exitCode , RandomGenerator . Instance ) ;
Original file line number Diff line number Diff line change 1
- using CSharpUtils ;
2
- using NUnit . Framework ;
3
- using System ;
4
- using System . Collections . Generic ;
5
- using System . Collections . ObjectModel ;
1
+ using System . Collections . ObjectModel ;
6
2
using System . Diagnostics ;
7
3
using System . Diagnostics . CodeAnalysis ;
8
- using System . Linq ;
9
4
using System . Text . RegularExpressions ;
5
+ using CSharpUtils ;
6
+ using NUnit . Framework ;
10
7
11
8
struct UserType
12
9
{
@@ -300,7 +297,7 @@ public static void StringArray_ReturnsAStringArrayWithLengthBetween0And2Populate
300
297
}
301
298
302
299
[ Test ]
303
- public static void ProcessResultWithExitCode_ReturnsNewProcessResultWithAllRandomFields ( )
300
+ public static void TestableProcessResultWithExitCode_DoesSo ( )
304
301
{
305
302
var randomGeneratorMock = Mock . Strict < RandomGenerator > ( ) ;
306
303
string fileName = TestRandom . String ( ) ;
You can’t perform that action at this time.
0 commit comments