From the course: C# Best Practices for Developers

Unlock the full course today

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

Unit testing without parameters

Unit testing without parameters - C# Tutorial

From the course: C# Best Practices for Developers

Start my 1-month free trial

Unit testing without parameters

- [Instructor] OK, so we are ready to create our test. Let's go ahead and hop on over to our actor test, but, before we do, I'm gonna copy this line, here, booking can change if actor starts trouble, because I'll be using that line. And, in our test file, our first test method will be for booking the actor without any specific date. So, we're not returning anything. The name is BookActor, but let's call this TestBookActor, and follow the convention. All your tests should indicate that you're testing, just to be consistent. And, we will be arranging our details. And, we know we will Act and Assert, so I'll just put those in, right now. But, we're not done arranging, yet. I'm going to use the variable currentActor and create a new instance. And, we're going to be passing in the actor name. And, for expected, we want the statement to say Actor Johnny Boy is booked, followed by details, indicating that, if he starts any problem, he's out. And, to get our result, I specify the…

Contents