Join Reynald Adolphe for an in-depth discussion in this video Unit testing without parameters, part of C# Best Practices for Developers.
- [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 currentActor,…and invoke BookActor.…
And now, let's check to see if these two values are equal,…
- Naming and handling classes
- Running a unit test
- Using constructors
- Naming and handling methods, fields, and properties
- Using properties correctly
- Managing objects efficiently
- Common design patterns as best practices
Skill Level Intermediate
1. Best Practices: An Overview
2. Naming and Handling Classes
3. Naming and Handling Methods, Fields, and Properties
4. Managing Objects Efficiently
5. More Best Practices Resources
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.