-
Notifications
You must be signed in to change notification settings - Fork 292
/
Manachers_Tests.cs
33 lines (26 loc) · 995 Bytes
/
Manachers_Tests.cs
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
using Advanced.Algorithms.String;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Advanced.Algorithms.Tests.String
{
[TestClass]
public class ManacherTests
{
[TestMethod]
public void Manacher_Palindrome_Tests()
{
var manacher = new ManachersPalindrome();
var length = manacher.FindLongestPalindrome("aacecaaa");
Assert.IsTrue(length == 7);
length = manacher.FindLongestPalindrome("baab");
Assert.IsTrue(length == 4);
length = manacher.FindLongestPalindrome("abaab");
Assert.IsTrue(length == 4);
length = manacher.FindLongestPalindrome("abaxabaxabb");
Assert.IsTrue(length == 9);
length = manacher.FindLongestPalindrome("abaxabaxabybaxabyb");
Assert.IsTrue(length == 11);
length = manacher.FindLongestPalindrome("abaxabaxabbaxabyb");
Assert.IsTrue(length == 10);
}
}
}