Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shrunsprint89/stringcalculatorkata
https://github.com/shrunsprint89/stringcalculatorkata
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/shrunsprint89/stringcalculatorkata
- Owner: shrunSprint89
- Created: 2025-01-06T11:18:26.000Z (18 days ago)
- Default Branch: main
- Last Pushed: 2025-01-06T12:27:14.000Z (18 days ago)
- Last Synced: 2025-01-06T12:31:01.281Z (18 days ago)
- Language: Python
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# String Calculator TDD Kata
This repo implements the String Calculator TDD Kata as defined by Roy Osherove (https://osherove.com/tdd-kata-1/). The kata involves creating a string calculator that can handle basic string parsing and addition with various rules and edge cases.
## Getting Started
### Prerequisites
- Python 3.x
- pytest### Installation
Clone this repository:
```bash
git clone https://github.com/shrunSprint89/stringCalculatorKata.git
cd stringCalculatorKata
```Install dependencies using pip:
```bash
pip install -r requirements.txt
```### Running Tests
To run the tests:
```bash
pytest
```### Using the Calculator
To use the string calculator in your code:
```python
from string_calculator import StringCalculatorcalculator = StringCalculator()
result = calculator.Add("1,2,3") # Returns 6
```The Add method accepts a string input containing numbers separated by commas and returns their sum. See the kata rules for supported formats and special cases.