Right Click on Test from Test explorer / or To any group –> Analyze Code Coverage for Selected Test.Test-> Analyze Code Coverage –> Selected Tests/ All Tests.You can start Analyze the “ Code Coverage” from Once we run the test method, While the unit test is passing, we need to check if our unit test covers the all code block for our method using the “ Code Coverage”. If you look back to the first articles of this series of posts, How to write your very first Unit Test in Visual Studio using MSTest Framework easily ?, we wrote the following code block to add two positive number and corresponding unit test. By analyzing the result, we can determine if the code is tested for all certain scenarios or we need write more test cases to covers some of the scenarios for the code block. Once you write the Unit tests in Visual Studio and manage them using Test Explorer, the next immediate job for you would be understand what code you have tested so far using the test cases ? Code Coverage let us determine which portion / section of the code has been tested. Understanding and maintaining the code coverage is one of the most important aspect of writing unit tests and ensures the code quality with respect to functional points.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |