This a Command-Line Interface (CLI) app, where you can work with a Dictionary data structure stored in memory. This dictionary is a key/value store that takes a string for the key and a string for the member (value). The member is stored in a HashSet data structure.
| Command | Parameters | Example | Description |
|---|---|---|---|
| ADD | <key> <member> |
ADD Batman Joker |
Adds a key and member pair to dictionary |
| KEYS | No parameters | KEYS |
Returns list of keys |
| MEMBERS | <key> |
MEMBERS Batman |
Returns members of a specific key |
| REMOVE | <key> <member> |
REMOVE Batman Joker |
Removes a specific member from a key |
| REMOVEALL | <key> |
REMOVEALL Batman |
Removes all members in a key, including the key itself |
| CLEAR | No parameters | CLEAR |
Removes all key and member pairs in dictionary |
| KEYEXISTS | <key> |
KEYEXISTS Batman |
Returns true if key exists in dictionary |
| MEMBEREXISTS | <key> <member> |
MEMBEREXISTS Batman Joker |
Returns true if member exists in a key |
| ALLMEMBERS | No parameters | ALLMEMBERS |
Returns all members in the dictionary |
| ITEMS | No parameters | ITEMS |
Returns all key and member pairs in dictionary |
| EXIT | No parameters | EXIT |
Closes application |
| CLEAREXCEPT | <key> |
CLEAREXCEPT WonderWoman |
Removes all key and member pairs except for specified key |
- Traditionally, the elements of a dictionary are called keys and values. In this app, the term "members" is used to refer to what are typically known as values
- Commands are case-sensitive. They must be uppercase
- Keys and Members must be one word. Ex:
ADD Batman Mr.FreezenotADD Batman Mr. Freeze
- Ensure you have Visual Studio 2022 installed with the .NET SDK.
- Clone the repository.
- Open Visual Studio.
- Open the Project/Solution.
- In the "Developer Command Prompt", run
dotnet restoreto restore all NuGet packages. - To open Developer Command Prompt go to "Tools" > "Command Line" > "Developer Command Prompt"
- Build the project by right-clicking on
Spreetail_Take_Home_Proj.slnand selectingBuild, or usedotnet buildin the Developer Command Prompt. - To run unit tests, enter
dotnet testin the Developer Command Prompt. - To run the app, click on the Start button with the green arrow. Ensure the startup project is set to either
CLI_App.csprojorCLI_App(if in the solution file).