Skip to content

Commit 3a85d58

Browse files
author
Gonzalo Diaz
committed
WIP
1 parent 831de54 commit 3a85d58

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

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)