The Elevator Challenge project simulates the operation of an elevator system. It includes various components such as models, services, and helpers to manage elevator operations, handle passenger requests, and display the system status on the console.
The project is organized into the following main directories:
- ElevatorChallenge: Contains the core implementation of the elevator system.
- ElevatorChallengeTests: Contains unit tests for the elevator system.
- .NET 8 SDK
- Visual Studio 2022 or later
Open the solution in Visual Studio and build the project to restore the dependencies and compile the code.
To run the application, set the ElevatorChallenge
project as the startup project and start debugging (F5). The console application will start, and you can interact with the elevator system via the console.
This directory contains the core implementation of the elevator system.
- Models: Contains the data models used in the project, such as
ElevatorStatus
,PassengerRequest
, andElevatorConfiguration
. - Services: Contains the service interfaces and implementations for managing elevator operations.
- Helpers: Contains helper classes for console output and elevator name generation.
This directory contains unit tests for the elevator system.
- ElevatorTests.cs: Contains unit tests for the
Elevator
class to verify its behavior under various scenarios.
- ElevatorStatus: Represents the status of an elevator, including its current floor, direction, and load.
- PassengerRequest: Represents a passenger request, including the origin floor, destination floor, and passenger count.
- ElevatorConfiguration: Represents the configuration settings for the elevator system.
- IControlCentreService: Interface for the control center service that manages elevator operations and passenger requests.
- IElevatorThreadManager: Interface for managing elevator threads.
- IConsoleOutputHelper: Interface for console output helper.
- ConsoleOutputHelper: Helper class for displaying information on the console.
- ElevatorNamesHelper: Helper class for generating elevator names based on their index.
To run the unit tests, open the Test Explorer in Visual Studio and run all tests. The tests are located in the ElevatorChallengeTests
project.