-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_1470_Shuffle_the_array_Test.cs
More file actions
57 lines (47 loc) · 1.4 KB
/
_1470_Shuffle_the_array_Test.cs
File metadata and controls
57 lines (47 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using Microsoft.VisualStudio.TestTools.UnitTesting;
using FluentAssertions;
using Solution._1470.Shuffle_the_array;
namespace _1470.Shuffle_the_array.Tests
{
[TestClass()]
public class _1470_Shuffle_the_array_Test
{
_1470_Shuffle_the_array solution = new _1470_Shuffle_the_array();
[TestMethod()]
public void Shuffle_Test1()
{
// Arrange
int[] nums = { 2, 5, 1, 3, 4, 7 };
int n = 3;
int[] expected = { 2, 3, 5, 4, 1, 7 };
// Act
var actual = solution.Shuffle(nums, n);
// Arrange
actual.Should().BeEquivalentTo(expected);
}
[TestMethod()]
public void Shuffle_Test2()
{
// Arrange
int[] nums = { 1, 2, 3, 4, 4, 3, 2, 1 };
int n = 4;
int[] expected = { 1, 4, 2, 3, 3, 2, 4, 1 };
// Act
var actual = solution.Shuffle(nums, n);
// Assert
actual.Should().BeEquivalentTo(expected);
}
[TestMethod()]
public void Shuffle_Test3()
{
// Arrange
int[] nums = { 1, 1, 2, 2 };
int n = 2;
int[] expected = { 1, 2, 1, 2 };
// Act
var actual = solution.Shuffle(nums, n);
// Assert
actual.Should().BeEquivalentTo(expected);
}
}
}