Beispiel #1
0
        public void Replacein_ReplaceWord_NewString()
        {
            //Arrange
            string sentence    = "Hello world";
            string findWord    = "world";
            string replaceWord = "universe";

            //Act
            FindReplace findReplaceTest = new FindReplace(sentence, findWord, replaceWord);
            string      result          = findReplaceTest.Replacein();

            //Assert
            Assert.Equal("Hello universe", result);
        }
Beispiel #2
0
        public void Replacein_ReplacenameWord_NewString()
        {
            //Arrange
            string sentence    = "I am walking my Cat to the cathedral";
            string findWord    = "CAT";
            string replaceWord = "dog";

            //Act
            FindReplace findReplaceTest = new FindReplace(sentence, findWord, replaceWord);
            string      result          = findReplaceTest.Replacein();

            //Assert
            Assert.Equal("I am walking my dog to the doghedral", result);
        }