Identify and demonstrate how you can change this code in a minimal way to make it testable.
- [Instructor] If you've been following along…with the code, I'd suggest you open the exercise files…at the begin state for this video, because I've changed…the state of the application a little bit.…So the change we need to make is to add coupon code to our…booking page, this is our booking page right now,…and we've added a coupon code field, but it's not…hooked up to anything.…We can choose the Winchester Room, click book now,…and it gives us the current estimated total.…Let's head over to Visual Studio now, and we'll start…looking for where we're going to make our changes.…We'll start by going to the booking controller,…and we'll go to the index post action.…
It looks like we'll have to make a small change here…to pass through the data from our booking view model,…and that gets passed into our calculate booking price…method in our booking service, so let's go there.…It looks like we'll have to make a change here too…to account for our coupon code.…So now we've identified where we want to make our changes,…
Note: Examples in this course were developed using C# ASP.NET Core, but the concepts apply to all .NET Core applications.
- Getting the TDD tools
- Testing cases
- Refactoring code
- Completing test cases
- Testing changes in untested code
- Changing code