There are 5 primary classes which have been implemented namely
- Booking
- BookingClasses
- Railways
- Station
- Date
The definition of each class as well as implementation of inline functions is in the file <ClassName>.h
The implementation of each class (excluding the unit tests) is in the file <ClassName>.cpp
The unit tests for each class are in the UnitTest<ClassName>.cpp files
Application.cpp contains initialisation of static constants which are changeable from the application space
Note that Application.cpp itself doesn't have a main function. Test files have been provided with main functions to run the code.
ApplicationTests.cpp contains application test code.
To see constructor and destructor calls add the flag -D_DEBUG to any compilation command
- UnitTestBooking
Done primarily in main application testing itself
- UnitTestStation
$ g++-10 -std=c++11 UnitTestStation.cpp Railways.cpp Station.cpp -o UnitTestStation
$ ./UnitTestStation
- UnitTestRailways
$ g++-10 -std=c++11 UnitTestRailways.cpp Railways.cpp Station.cpp -o UnitTestRailways
$ ./UnitTestRailways
- UnitTestConcession
$ g++-10 -std=c++11 UnitTestConcession.cpp Concession.cpp Gender.cpp BookingClasses.cpp Application.cpp Divyaang.cpp Passenger.cpp Date.cpp Name.cpp -o UnitTestConcession
$ ./UnitTestConcession
- UnitTestDivyaang
$ g++-10 -std=c++11 UnitTestDivyaang.cpp Divyaang.cpp BookingClasses.cpp Application.cpp -o UnitTestDivyaang
$ ./UnitTestDivyaang
- UnitTestPassenger
$ g++-10 -std=c++11 UnitTestPassenger.cpp Passenger.cpp Date.cpp Name.cpp Gender.cpp Divyaang.cpp Application.cpp -o UnitTestPassenger
$ ./UnitTestPassenger
- UnitTestName
$ g++-10 -std=c++11 UnitTestName.cpp Name.cpp -o UnitTestName
$ ./UnitTestName
- UnitTestDate
$ g++-10 -std=c++11 UnitTestDate.cpp Date.cpp -o UnitTestDate
$ ./UnitTestDate
- UnitTestGender
$ g++-10 -std=c++11 UnitTestGender.cpp Gender.cpp Application.cpp -o UnitTestGender
$ ./UnitTestGender
- UnitTestBookingClasses
$ g++-10 -std=c++11 UnitTestBookingClasses.cpp Application.cpp BookingClasses.cpp -o UnitTestBookingClasses
$ ./UnitTestBookingClasses
- ApplicationTestsExceptional
$ g++-10 -std=c++11 ApplicationTestsExceptional.cpp Booking.cpp BookingCategory.cpp Concession.cpp Gender.cpp BookingClasses.cpp Application.cpp Divyaang.cpp Passenger.cpp Date.cpp Name.cpp Station.cpp Railways.cpp -o ApplicationTestsExceptional
$ ./ApplicationTestsExceptional
- ApplicationTestsHappy
$ g++-10 -std=c++11 ApplicationTestsHappy.cpp Booking.cpp BookingCategory.cpp Concession.cpp Gender.cpp BookingClasses.cpp Application.cpp Divyaang.cpp Passenger.cpp Date.cpp Name.cpp Station.cpp Railways.cpp -o ApplicationTestsHappy
$ ./ApplicationTestsHappy