Skip to content

AlbinCode/TDD-Assignment-Abbe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages