File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed
src/algorithm_exercises_csharp_test
hackerrank/interview_preparation_kit/arrays Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class HelloWorldBruteForceTest
9
9
public void testInitialize ( )
10
10
{
11
11
var envValue = Environment . GetEnvironmentVariable ( "BRUTEFORCE" ) ;
12
- envValue = envValue ? . ToUpper ( ) ;
12
+ envValue = envValue ? . ToUpperInvariant ( ) ;
13
13
if ( ! allowedValues . Contains ( envValue , StringComparer . OrdinalIgnoreCase ) )
14
14
{
15
15
Assert . Inconclusive ( $ "Skipping BRUTEFORCE test because environment variable 'BRUTEFORCE' is not one of the expected values.") ;
@@ -20,7 +20,7 @@ public void testInitialize()
20
20
public void testHelloBruteForce ( )
21
21
{
22
22
string expected = "Hello World!" ;
23
- string result = HelloWorld . hello ( ) ;
23
+ string result = HelloWorld . create ( ) . hello ( ) ;
24
24
25
25
Assert . AreEqual ( expected , result ) ;
26
26
}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public void testInstance()
34
34
public void testHello ( )
35
35
{
36
36
string expected = "Hello World!" ;
37
- string result = HelloWorld . hello ( ) ;
37
+ string result = HelloWorld . create ( ) . hello ( ) ;
38
38
39
39
Assert . AreEqual ( expected , result ) ;
40
40
}
Original file line number Diff line number Diff line change @@ -5,11 +5,24 @@ namespace algorithm_exercises_csharp_test.hackerrank.interview_preparation_kit.a
5
5
[ TestClass ]
6
6
public class ArraysLeftRotationTest
7
7
{
8
- public class ArraysLeftRotationsTestCase
8
+ public class ArraysLeftRotationsTestCase ( int [ ] input , int d , int [ ] expected )
9
9
{
10
- public List < int > input { get ; set ; } = default ! ;
11
- public int d { get ; set ; }
12
- public List < int > expected { get ; set ; } = default ! ;
10
+ private readonly List < int > input = input . ToList ( ) ;
11
+ private readonly int d = d ;
12
+ private readonly List < int > expected = expected . ToList ( ) ;
13
+
14
+ public List < int > Input
15
+ {
16
+ get { return input ; }
17
+ }
18
+ public int D
19
+ {
20
+ get { return d ; }
21
+ }
22
+ public List < int > Expected
23
+ {
24
+ get { return expected ; }
25
+ }
13
26
}
14
27
15
28
private List < ArraysLeftRotationsTestCase > testCases = default ! ;
@@ -29,8 +42,8 @@ public void testRotLeft()
29
42
30
43
foreach ( ArraysLeftRotationsTestCase test in testCases )
31
44
{
32
- result = ArraysLeftRotation . rotLeft ( test . input , test . d ) ;
33
- CollectionAssert . AreEquivalent ( test . expected , result ) ;
45
+ result = ArraysLeftRotation . rotLeft ( test . Input , test . D ) ;
46
+ CollectionAssert . AreEquivalent ( test . Expected , result ) ;
34
47
}
35
48
}
36
49
}
You can’t perform that action at this time.
0 commit comments