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
99 public void testInitialize ( )
1010 {
1111 var envValue = Environment . GetEnvironmentVariable ( "BRUTEFORCE" ) ;
12- envValue = envValue ? . ToUpper ( ) ;
12+ envValue = envValue ? . ToUpperInvariant ( ) ;
1313 if ( ! allowedValues . Contains ( envValue , StringComparer . OrdinalIgnoreCase ) )
1414 {
1515 Assert . Inconclusive ( $ "Skipping BRUTEFORCE test because environment variable 'BRUTEFORCE' is not one of the expected values.") ;
@@ -20,7 +20,7 @@ public void testInitialize()
2020 public void testHelloBruteForce ( )
2121 {
2222 string expected = "Hello World!" ;
23- string result = HelloWorld . hello ( ) ;
23+ string result = HelloWorld . create ( ) . hello ( ) ;
2424
2525 Assert . AreEqual ( expected , result ) ;
2626 }
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public void testInstance()
3434 public void testHello ( )
3535 {
3636 string expected = "Hello World!" ;
37- string result = HelloWorld . hello ( ) ;
37+ string result = HelloWorld . create ( ) . hello ( ) ;
3838
3939 Assert . AreEqual ( expected , result ) ;
4040 }
Original file line number Diff line number Diff line change @@ -5,11 +5,24 @@ namespace algorithm_exercises_csharp_test.hackerrank.interview_preparation_kit.a
55[ TestClass ]
66public class ArraysLeftRotationTest
77{
8- public class ArraysLeftRotationsTestCase
8+ public class ArraysLeftRotationsTestCase ( int [ ] input , int d , int [ ] expected )
99 {
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+ }
1326 }
1427
1528 private List < ArraysLeftRotationsTestCase > testCases = default ! ;
@@ -29,8 +42,8 @@ public void testRotLeft()
2942
3043 foreach ( ArraysLeftRotationsTestCase test in testCases )
3144 {
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 ) ;
3447 }
3548 }
3649}
You can’t perform that action at this time.
0 commit comments