Skip to content

Latest commit

Β 

History

History
89 lines (71 loc) Β· 2.62 KB

File metadata and controls

89 lines (71 loc) Β· 2.62 KB

TDD Assignment Abbe πŸ“š

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.

Features ✨

Inventory Management

  • Add, remove, and track items in an inventory.
  • Check for out-of-stock items.

String Processor

  • Sanitize strings, remove unwanted characters, and perform case conversions.
  • Compare strings with various criteria.

Bank Account

  • Handle deposits, withdrawals, and balance checks.
  • Includes validation for negative or zero transactions.

Weather Client

  • Fetch current weather data asynchronously.
  • Handle HTTP requests with mock responses.

Booking System πŸ—“οΈ

  • 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.

Technology Stack πŸ› οΈ

  • C#: The programming language.
  • xUnit: Testing framework.
  • NSubstitute: For mocking dependencies in tests.

Folder Structure πŸ“‚

.
β”œβ”€β”€ 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

How to Run πŸš€

  1. Clone the repository:
    git clone https://github.com/OtrevligAbbe/TDD-Assignment-Abbe
  2. Open the solution in Visual Studio.
  3. Build the solution to restore dependencies.
  4. Run all tests using the Test Explorer.

Tests πŸ§ͺ

  • Tests are written for all major components using xUnit.
  • Mocking is done with NSubstitute to isolate dependencies.
  • To run tests:
    1. Open the Test Explorer in Visual Studio.
    2. Run all tests.

License πŸ“œ

This project is licensed under the MIT License.