-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_0841_Keys_and_rooms_Test.cs
More file actions
74 lines (64 loc) · 1.78 KB
/
_0841_Keys_and_rooms_Test.cs
File metadata and controls
74 lines (64 loc) · 1.78 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
67
68
69
70
71
72
73
74
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._0841.Keys_and_rooms;
namespace _0841.Keys_and_rooms.Tests
{
[TestClass()]
public class _0841_Keys_and_rooms_Test
{
_0841_Keys_and_rooms solution = new _0841_Keys_and_rooms();
[TestMethod()]
public void CanVisitAllRooms_Test1()
{
// Arrange
int[][] rooms =
{
new int[] { 1 },
new int[] { 2 },
new int[] { 3 },
new int[] { },
};
// Act
var actual = solution.CanVisitAllRooms(rooms);
// Assert
Assert.IsTrue(actual);
}
[TestMethod()]
public void CanVisitAllRooms_Test2()
{
// Arrange
int[][] rooms =
{
new int[] { 1, 3 },
new int[] { 3, 0, 1 },
new int[] { 2 },
new int[] { 0 },
};
// Act
var actual = solution.CanVisitAllRooms(rooms);
// Assert
Assert.IsFalse(actual);
}
[TestMethod()]
public void CanVisitAllRooms_Test3()
{
// Arrange
int[][] rooms =
{
new int[] { 6, 7, 8 },
new int[] { 5, 4, 9 },
new int[] { },
new int[] { 8 },
new int[] { 4 },
new int[] { },
new int[] { 1, 9, 2, 3 },
new int[] { 7 },
new int[] { 6, 5 },
new int[] { 2, 3, 1 },
};
// Act
var actual = solution.CanVisitAllRooms(rooms);
// Assert
Assert.IsTrue(actual);
}
}
}