Join Reynald Adolphe for an in-depth discussion in this video Running a unit test, part of C# Best Practices for Developers.
- [Narrator] Now I'll go to our unit test.…And let's rename this UnitTest to ActorTest.…When I hit enter, it'll ask me…if I want to go ahead and rename my class,…and I'll say yes to that.…And you can see Visual Studio nicely does that.…And our next step should be to add a reference…to our project that we're going to be…referencing the class from.…
So by right clicking on reference,…I'll go ahead and choose projects,…and now I'll have my option for Prestige.biz.…Click OK here.…And let's go ahead and rename this method…to TestGetOccupation.…And there's going to be three steps.…If you're familiar with test-driven development,…there's arrange, act, and assert.…
And again, I go into detail on this…in my test-driven development course.…So for arrangement, we'll have our current Actor.…And create a new instance.…By holding the control key down and period,…I'm able to select the name space…using Prestige.biz.…And now it'll recognize Actor.…
Now the expected result that we want is Actor.…And that's what we will compare…against what we actually get.…
- 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.