Пример #1
0
        public void Test_UniqueChar_Should_Return_Second_Letter()
        {
            //Given, When
            char letter = StringOperations.FirstUniqueCharacter("aabcd");

            //Then
            Assert.Equal('b', letter);
        }
Пример #2
0
        public void Test_UniqueChar_Should_Return_first_char_ONE_letter()
        {
            //Given, When
            char letter = StringOperations.FirstUniqueCharacter("a");

            //Then
            Assert.Equal('a', letter);
        }
Пример #3
0
        public void Test_UniqueChar_Should_Return_Null_When_NO_Character_was_Found()
        {
            //Given, When
            Action exception = () => StringOperations.FirstUniqueCharacter("ababbbcc");

            //Then
            Assert.Throws <InvalidOperationException>(exception);
        }
Пример #4
0
        public void Test_UniqueChar_Should_Return_correctly_For_More_COMPLEX_Word()
        {
            //Given, When
            char letter = StringOperations.FirstUniqueCharacter("ababbbcd");

            //Then
            Assert.Equal('c', letter);
        }
Пример #5
0
        public void Test_FirstUniqueCharacter()
        {
            var ch = StringOperations.FirstUniqueCharacter("abcdabcdD");

            Assert.Equal('D', ch);
        }