https://github.com/cvigueras/search-city-functionality-kata
Search city functionality in TDD
https://github.com/cvigueras/search-city-functionality-kata
csharp tdd tdd-kata testing
Last synced: 8 months ago
JSON representation
Search city functionality in TDD
- Host: GitHub
- URL: https://github.com/cvigueras/search-city-functionality-kata
- Owner: cvigueras
- License: mit
- Created: 2023-04-03T14:15:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T09:54:06.000Z (over 2 years ago)
- Last Synced: 2025-01-05T16:33:11.707Z (10 months ago)
- Topics: csharp, tdd, tdd-kata, testing
- Language: C#
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# search-city-functionality-kata
Implement a city search functionality. The function takes a string (search text) as input and returns the found cities which corresponds to the search text.
# Prerequisites
* Create a collection of strings that will act as a database for the city names:
City names: Paris, Budapest, Skopje, Rotterdam, Valencia, Vancouver, Amsterdam, Vienna, Sydney, New York City, London, Bangkok, Hong Kong, Dubai, Rome, Istanbul.
# Requirements
1. If the search text is fewer than 2 characters, then should return no results. (It is an optimization feature of the search functionality.)
2. If the search text is equal to or more than 2 characters, then it should return all the city names starting with the exact search text.
* For example for search text “Va”, the function should return Valencia and Vancouver
3. The search functionality should be case insensitive.
4. The search functionality should work also when the search text is just a part of a city name.
5. If the search text is a “*” (asterisk), then it should return all the city names.