Welcome to the TDD Assignment Abbe repository! This project demonstrates the principles of Test-Driven Development (TDD) with a focus on various functionalities like inventory management, string processing, banking operations, and booking systems.
- Add, remove, and track items in an inventory.
- Check for out-of-stock items.
- Sanitize strings, remove unwanted characters, and perform case conversions.
- Compare strings with various criteria.
- Handle deposits, withdrawals, and balance checks.
- Includes validation for negative or zero transactions.
- Fetch current weather data asynchronously.
- Handle HTTP requests with mock responses.
- Manage bookings with available time slots.
- Includes:
- BookingSystem: Core logic for booking operations.
- BookingSystemFacade: Simplified interface for managing bookings.
- Tests implemented using xUnit and NSubstitute.
- C#: The programming language.
- xUnit: Testing framework.
- NSubstitute: For mocking dependencies in tests.
.
βββ Classes
β βββ BankAccount.cs
β βββ BookingSystem.cs
β βββ Calculator.cs
β βββ InventoryManager.cs
β βββ ObjectValidator.cs
β βββ StringProcessor.cs
β βββ WeatherClient.cs
βββ Facade
β βββ BookingSystemFacade.cs
β βββ WeatherClientFacade.cs
βββ Interfaces
β βββ IBookingSystem.cs
β βββ IWeatherClient.cs
βββ Test
β βββ BankAccountTest.cs
β βββ BookingSystemTest.cs
β βββ BookingSystemFacadeTest.cs
β βββ CalculatorTest.cs
β βββ InventoryManagerTest.cs
β βββ ObjectValidatorTest.cs
β βββ StringProcessorTest.cs
β βββ WeatherClientTest.cs
β βββ WeatherClientFacadeTest.cs
βββ TestHelpers
βββ MockHttpMessageHandler.cs
- Clone the repository:
git clone https://github.com/OtrevligAbbe/TDD-Assignment-Abbe
- Open the solution in Visual Studio.
- Build the solution to restore dependencies.
- Run all tests using the Test Explorer.
- Tests are written for all major components using xUnit.
- Mocking is done with NSubstitute to isolate dependencies.
- To run tests:
- Open the Test Explorer in Visual Studio.
- Run all tests.
This project is licensed under the MIT License.