public void Test() { var solution = new LongestCommonPrefixSolution(); Assert.AreEqual("fl", solution.LongestCommonPrefix(new[] { "flower", "flow", "flight" })); Assert.AreEqual("", solution.LongestCommonPrefix(new[] { "dog", "racecar", "car" })); }
public void Common_Test() { // Arrange var solution = new LongestCommonPrefixSolution(); //act var result = solution.LongestCommonPrefix(new string[] { "aa", "a" }); //Assert Assert.Equal("a", result); }
public void Empty_First_Massive_Item_Result_Should_Be_Empty_String() { // Arrange var solution = new LongestCommonPrefixSolution(); //act var result = solution.LongestCommonPrefix(new string[] { "" }); //Assert Assert.Equal(string.Empty, result); }
public void LongestCommonPrefixTest(string[] strs, string expected) { var actual = new LongestCommonPrefixSolution().LongestCommonPrefix(strs); Assert.Equal(expected, actual); }