Exemple #1
0
        public void NoCommonPrefixReturnsEmptyString()
        {
            var input = new[] { "cat", "bat", "hat" };
            var lcp   = new LongestCommonPrefix();

            Assert.Equal("", lcp.longestCommonPrefix(input));
        }
Exemple #2
0
        public void StringsCanShareCommonPrefix()
        {
            var input = new[] { "aab", "aabcd" };
            var lcp   = new LongestCommonPrefix();

            Assert.Equal("aab", lcp.longestCommonPrefix(input));
        }
Exemple #3
0
        public void ReturnsEmptyStringForNoInput()
        {
            var lcp = new LongestCommonPrefix();

            Assert.Equal("", lcp.longestCommonPrefix(null));
        }