Exemplo n.º 1
0
        public void SwapWords_UpperCaseDictionary_Swap()
        {
            // Arrange
            string textToAnalyse      = "aaa aaa";
            string expected           = "BBB BBB";
            var    swappingDictionary = new Dictionary <string, string> {
                { "AAA", "BBB" }
            };

            // Act
            string actual = Swapper.SwapWords(textToAnalyse, swappingDictionary);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void SwapWords_CompoundAndNonCompundWords_SwapNonCompoundsWord()
        {
            // Arrange
            string textToAnalyse      = "aaabbb aaa";
            string expected           = "aaabbb ccc";
            var    swappingDictionary = new Dictionary <string, string> {
                { "aaa", "ccc" }
            };

            // Act
            string actual = Swapper.SwapWords(textToAnalyse, swappingDictionary);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 3
0
        public void SwapWords_OneWord_Swap()
        {
            // Arrange
            string word               = "word";
            string expected           = "swapped";
            var    swappingDictionary = new Dictionary <string, string> {
                { word, expected }
            };

            // Act
            string actual = Swapper.SwapWords(word, swappingDictionary);

            // Assert
            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 4
0
        public void SwapWords_MultipleWords_Swap()
        {
            // Arrange
            string textToAnalyse      = "aaa bbb ccc";
            string expected           = "ddd eee ccc";
            var    swappingDictionary = new Dictionary <string, string> {
                { "aaa", "ddd" },
                { "bbb", "eee" }
            };

            // Act
            string actual = Swapper.SwapWords(textToAnalyse, swappingDictionary);

            // Assert
            Assert.AreEqual(expected, actual);
        }