This repository was archived by the owner on Jan 20, 2026. It is now read-only.
Update test cases for compulsory #2#30
Merged
Merged
Conversation
|
The file is linked to HotelBooking.WebApi collection in Postman. |
# Conflicts: # Postman/29107717-35415cbc-fe85-403f-8ca2-b3935561d349.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactorings to the hotel booking system's BDD tests, booking logic, and Postman collections. The main focus is on making the BDD tests more robust and maintainable by introducing utility methods for test data setup, refining booking logic for date comparisons, and updating API test collections for accuracy and consistency.
Test Infrastructure and Logic Improvements
Utilitiesclass (HotelBooking.BDDTests.Utils.Utilities) that provides reusable mock setup methods for repositories, improving the maintainability and clarity of BDD tests. The booking repository mock now includes bookings for both available and fully occupied periods, supporting more realistic test scenarios.BookingStepDefinitionsto use the new utility methods for setting up mocks, removing inline mock setup and simplifying the test class construction. [1] [2]Booking Logic Fixes
BookingManagerto use date-only comparisons (DateTime.Date) for booking overlaps, fixing potential issues with time components affecting booking results.BDD Feature and Scenario Enhancements
Booking.featurefile by introducing aBackgroundsection to define a fully booked period, converting scenarios to use outlines with parameterized date offsets, and updating test cases for both successful and failed bookings. This makes the feature file more descriptive and test coverage more comprehensive. [1] [2] [3]API Testing and Postman Collection Updates
HotelBooking.postman_collection.jsonand related files) with new IDs, improved response metadata, and more realistic request/response payloads for bookings. Adjusted scripts to use deterministic values for key fields, ensuring consistent and predictable API tests. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21]Build and Test Pipeline Adjustment
Test) instead of setting environment variables directly, aligning the test environment setup with .NET best practices.