-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_0014_Longest_common_prefix_Test.cs
More file actions
39 lines (32 loc) · 1022 Bytes
/
_0014_Longest_common_prefix_Test.cs
File metadata and controls
39 lines (32 loc) · 1022 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
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Solution._0014.Longest_common_prefix;
namespace _0014.Longest_common_prefix.Tests
{
[TestClass()]
public class _0014_Longest_common_prefix_Test
{
_0014_Longest_common_prefix solution = new _0014_Longest_common_prefix();
[TestMethod()]
public void LongestCommonPrefix_Test1()
{
// Arrange
string[] strs = { "flower", "flow", "flight" };
var expected = "fl";
// Act
var actual = solution.LongestCommonPrefix(strs);
// Assert
Assert.AreEqual(expected, actual);
}
[TestMethod()]
public void LongestCommonPrefix_Test2()
{
// Arrange
string[] strs = { "dog", "racecar", "car" };
var expected = "";
// Act
var actual = solution.LongestCommonPrefix(strs);
// Assert
Assert.AreEqual(expected, actual);
}
}
}