MsTest has a handful of useful attributes for test methods. This tutorial looks at the Description, Owner and TestProperty attributes and how their information appears in the Test Explorer.
- [Voiceover] There are a number of additional attributes…available from MSTest.…I'll start with the Ignore attribute,…which provides a temporary way to disable a TestMethod.…In my test class, I have eight unit tests.…They're all running successfully at the moment.…For this example, I'd like to ignore two of these tests.…There's a couple of ways I could remove these tests…from Test Explorer.…One is I could remove the TestMethod attribute.…Then it will no longer appear in Test Explorer.…And, of course, that means I can't run it.…I can also use the Ignore attribute,…which means it still shows up in Test Explorer,…it's just I can't run the unit test…while it's marked as ignored.…
I've added the Ignore attribute to two of my methods.…Now I'll rerun the tests.…Test Explorer shows me that I have six successful tests,…and two of my tests are marked with the yellow icon,…which means that they're ignored.…You'll also notice that the status bar…at the top is orange too,…which signifies that some of my tests are being ignored.…
- Examining types of frameworks
- Choosing a naming convention
- Creating unit tests
- Running unit tests with Visual Studio
- Modifying and correcting code
- Handling exceptions
- Installing and using nUnit
- Viewing test results with CodeLens
Skill Level Beginner
Q: This course was updated on 08/22/2017. What changed?
A: New videos were added that cover live unit testing and creating a project with the unit test framework.
1. Create a Simple Unit Test Framework
2. Unit Testing Conventions
Choose a naming convention5m 59s
3. Work with Visual Studio Unit Testing Framework
4. Work with xUnit
5. Work with nUnit
6. Additional Topics
- 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.