Find and Replace

By Cassandra Copp, Carlos Mendez, and Cristina Plesa

Application asks user for an input of a string, and to then replace one of the words in the string. Application returns back the newly built string with changed word

Technologies Used

  • C#
  • .NET 5
  • MS Test

Setup and Use

Prerequisites

  • .NET 5 SDK
  • A text editor like VS Code
  • A command line interface like Terminal or GitBash to run and interact with the console app.

Installation

  1. Clone the repository: $ git clone https://github.com/cass1618/FindAndReplace.Solution
  2. Navigate to the FindAndReplace.Solution/ directory on your computer
  3. Open with your preferred text editor to view the code base
  4. To run the console app:
    • Navigate to FindAndReplace.Solution/FindAndReplace in your command line
    • Run the command dotnet restore to restore the dependencies that are listed in the .csproj
    • Run the command dotnet build to build the project and its dependencies into a set of binaries
    • Finally, run the command dotnet run to run the project!
    • Note: dotnet run also restores and builds the project, so you can use this single command to start the console app
  5. To run tests:
    • Navigate to FindAndReplace.Solution/FindAndReplace.Tests in your command line.
    • Run the command dotnet restore to restore the dependencies that are listed in the .csproj
    • Finally, run the command dotnet test to run the tests!

Specs

ReplacerTests

{ [TestMethod] public void Replace_HelloWorld_HelloUniverse() { // Arrange string userString = "Hello World"; string wordToReplace = "World"; string newWord = "Universe"; Replacer testReplacer = new Replacer(); // Act string stringMethod = testReplacer.ReplacerFunction(userString, wordToReplace, newWord); string outputString = "Hello Universe"; // Assert Assert.AreEqual( outputString, stringMethod ); } }

Known bugs

This webpage has no known bugs.

License

MIT

Copywrite (c) Cassandra Copp 2021.

Contact Information

github.com/cass1618

github.com/CristinaPlesa

github.com/yesthecarlos