-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_0733_Flood_fill_Test.cs
More file actions
66 lines (57 loc) · 1.61 KB
/
_0733_Flood_fill_Test.cs
File metadata and controls
66 lines (57 loc) · 1.61 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
58
59
60
61
62
63
64
65
66
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._0733.Flood_fill;
namespace _0733.Flood_fill.Tests
{
[TestClass()]
public class _0733_Flood_fill_Test
{
_0733_Flood_fill solution = new _0733_Flood_fill();
[TestMethod()]
public void FloodFill_Test1()
{
// Arrange
int[][] image = new int[][]
{
new int[] { 1, 1, 1 },
new int[] { 1, 1, 0 },
new int[] { 1, 0, 1 },
};
int sr = 1;
int sc = 1;
int newColor = 2;
var expected = new int[][]
{
new int[] { 2, 2, 2 },
new int[] { 2, 2, 0 },
new int[] { 2, 0, 1 },
};
// Act
var actual = solution.FloodFill(image, sr, sc, newColor);
// Assert
actual.Should().BeEquivalentTo(expected);
}
[TestMethod()]
public void FloodFill_Test2()
{
// Arrange
int[][] image = new int[][]
{
new int[] { 0, 0, 0 },
new int[] { 0, 0, 0 },
};
int sr = 0;
int sc = 0;
int newColor = 2;
var expected = new int[][]
{
new int[] { 2, 2, 2 },
new int[] { 2, 2, 2 },
};
// Act
var actual = solution.FloodFill(image, sr, sc, newColor);
// Assert
actual.Should().BeEquivalentTo(expected);
}
}
}