Example #1
0
        public void LengthOfLongestSubstringTest4()
        {
            LongestSubstring longestSubstring = new LongestSubstring();
            int res = longestSubstring.LengthOfLongestSubstring("");

            Assert.IsTrue(res == 0);
        }
Example #2
0
        public void LengthOfLongestSubstringTest3()
        {
            LongestSubstring longestSubstring = new LongestSubstring();
            int res = longestSubstring.LengthOfLongestSubstring("pwwkew");

            Assert.IsTrue(res == 3);
        }
Example #3
0
        public void LengthOfLongestSubstringTest1()
        {
            LongestSubstring longestSubstring = new LongestSubstring();
            int res = longestSubstring.LengthOfLongestSubstring("abcabcbb");

            Assert.IsTrue(res == 3);
        }
        public void LengthOfLongestSubstring_ShouldReturn_LengthOfLongestNonRepeatedSubstring(
            string s,
            int expectedMaximumLength)
        {
            // Arrange
            var longestSubstring = new LongestSubstring();

            // Act
            var maximumLength = longestSubstring.LengthOfLongestSubstring(s);

            // Assert
            maximumLength.Should().Be(expectedMaximumLength);
        }
        void InternalTest(string s, int expected)
        {
            int count = LongestSubstring.LengthOfLongestSubstring(s);

            Assert.Equal <int>(expected, count);
        }
Example #6
0
        public void LengthOfLongestSubstringTest(string s, int expected)
        {
            var sut = new LongestSubstring();

            Assert.Equal(expected, sut.LengthOfLongestSubstring(s));
        }
        public void LengthOfLongestSubstringTest(string input, int expected)
        {
            var actual = _sut.LengthOfLongestSubstring(input);

            Assert.AreEqual(expected, actual);
        }