Skip to content

Commit b6b19f4

Browse files
author
Gonzalo Diaz
committed
split-off! WIP
1 parent 63ab8fb commit b6b19f4

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

src/algorithm_exercises_csharp_test/Hello.BruteForce.Test.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
}

src/algorithm_exercises_csharp_test/Hello.Test.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/algorithm_exercises_csharp_test/hackerrank/interview_preparation_kit/arrays/ArraysLeftRotation.Test.cs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,24 @@ namespace algorithm_exercises_csharp_test.hackerrank.interview_preparation_kit.a
55
[TestClass]
66
public 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
}

0 commit comments

Comments
 (0)