Beispiel #1
0
        public void Common_Test()
        {
            // Arrange
            var solution = new LongestSubstringWithoutRepeatingCharactersSolution();
            var expected = 6;

            //act
            var result = solution.LengthOfLongestSubstring("abcdefdc");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #2
0
        public void Last_Part_Is_Longest_Substring()
        {
            // Arrange
            var solution = new LongestSubstringWithoutRepeatingCharactersSolution();
            var expected = 8;

            //act
            var result = solution.LengthOfLongestSubstring("abcabcdefrabcdefrt");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #3
0
        public void Duplications_In_Beginning()
        {
            // Arrange
            var solution = new LongestSubstringWithoutRepeatingCharactersSolution();
            var expected = 2;

            //act
            var result = solution.LengthOfLongestSubstring("aab");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #4
0
        public void Test_With_Duplicate_Chars()
        {
            // Arrange
            var solution = new LongestSubstringWithoutRepeatingCharactersSolution();
            var expected = 3;

            //act
            var result = solution.LengthOfLongestSubstring("pwwkew");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #5
0
        public void Second_Part_Is_Right_Sub_String()
        {
            // Arrange
            var solution = new LongestSubstringWithoutRepeatingCharactersSolution();
            var expected = 5;

            //act
            var result = solution.LengthOfLongestSubstring("abcdabcde");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #6
0
        public void Zero_Length()
        {
            // Arrange
            var solution = new LongestSubstringWithoutRepeatingCharactersSolution();
            var expected = 0;

            //act
            var result = solution.LengthOfLongestSubstring("");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #7
0
 public void Test1()
 {
     var lengthOfLongestSubstring = new LongestSubstringWithoutRepeatingCharactersSolution().LengthOfLongestSubstring("abba");
 }