Ejemplo n.º 1
0
        public void LengthOfLongestSubstringTest4()
        {
            LongestSubstring longestSubstring = new LongestSubstring();
            int res = longestSubstring.LengthOfLongestSubstring("");

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

            Assert.IsTrue(res == 3);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
        void InternalTest(string s, int expected)
        {
            int count = LongestSubstring.LengthOfLongestSubstring(s);

            Assert.Equal <int>(expected, count);
        }
Ejemplo n.º 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);
        }