From the course: C# Best Practices for Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Unit testing with parameters

Unit testing with parameters - C# Tutorial

From the course: C# Best Practices for Developers

Start my 1-month free trial

Unit testing with parameters

- [Instructor] So we're ready to create our second test method. Before I do, let me go ahead and closeout these other files that we don't need. And I will copy line 33 through 45, and paste. And let's modify this. On specific date. Now, the next line that we're going to want to change is actor Johnny Boy is booked. And we'll indicate on. And we'll use date time for today, and convert it to a string, specifically a short date string. And concatenate that, and add a period along with the details. And this time for act we are going to pass in the date, because if we recall we have our date string parameter that we can pass in. So I'll right-click on our test, and run, and see if we pass. And it does. So let's go ahead and summarize our best practices as it relates to overloading. You want to include comments when it's necessary, when you feel that it's needed, and it adds a value. Something else to keep in mind is to not use too many parameters. We didn't pass like seven or eight…

Contents