Oregon Trail Mini Project
Let’s build a small application to practice what we’ve learned in Mods 1, 2, and 3. Read throught the entire spec below before starting!
The Oregon Trail
- Fork and Clone this starter repo
- Open your forked repository in visual studio
- Build the solution - let you instructor know if you get any errors!
Building our Models
- Create a branch called
models
- In your Caravan project, add classes outlined below.
- Commit after each class is complete.
- When all three classes have been built, create a Pull Request to merge your
models
branch into yourmain
branch. - Merge your branch into
main
(using your PR!).
Passenger
A passenger has a Name, an Age, a Destination, and a Wagon
Wagon
A Wagon has a Name (like ‘Old Faithful’), NumWheels, Covered (true/false), and Passengers.
Creating our Database
- Checkout a new branch called
migrations
- Update the CaravanContext class to make sure our tables for wagons and passengers get created.
- Add a migration to create your database.
- Run your migration!
- Commit your work, and merge your
migrations
branch into yourmain
branch using a Pull Request.
User Stories
Update your MVC application to fulfill the following user stories. Create brances for individual features.
As a User
When I visit "/wagons"
Then I see a list of all wagon names
Each wagon name is a link to that wagon's show page
As a User
When I visit "/wagons/2"
Then I see the details of the wagon with id 2
Then I see all of the passengers riding in that wagon
Then I see a link to add a passenger to that wagon
As a User
When I visit "/wagons/2/passengers/new"
And I fill in the form with a passenger's name, age and destination
And I click 'Add Passenger'
Then I am redirected to that wagon's show page
And I see the new passenger
As a User
When I visit "/wagons"
Then I see a count of passengers for each wagon
As a User
When I visit "/overview"
Then I see a distinct list of destinations
As a User
When I visit "/overview"
Then I see the average age of all passengers
As a User
When I visit "/wagons"
Then I see the average age of passengers in each wagon
As a User
When I visit "/passengerlist"
Then I see a list of all passenger names and the wagon they are riding in