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.

Running a unit test

Running a unit test - C# Tutorial

From the course: C# Best Practices for Developers

Start my 1-month free trial

Running a unit test

- [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…

Contents