-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_0234_Palindrome_linked_list_Test.cs
More file actions
40 lines (33 loc) · 1009 Bytes
/
_0234_Palindrome_linked_list_Test.cs
File metadata and controls
40 lines (33 loc) · 1009 Bytes
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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._0234.Palindrome_linked_list;
using Common;
namespace _0234.Palindrome_linked_list.Tests
{
[TestClass()]
public class _0234_Palindrome_linked_list_Test
{
_0234_Palindrome_linked_list solution = new _0234_Palindrome_linked_list();
[TestMethod()]
public void IsPalindrome_Test1()
{
// Arrange
ListNode head = new ListNode();
head = head.AddNode(new int[] { 1, 2, 2, 1 });
// Act
var actual = solution.IsPalindrome(head);
// Assert
Assert.IsTrue(actual);
}
[TestMethod()]
public void IsPalindrome_Test2()
{
// Arrange
ListNode head = new ListNode();
head = head.AddNode(new int[] { 1, 2 });
// Act
var actual = solution.IsPalindrome(head);
// Assert
Assert.IsFalse(actual);
}
}
}