Nowadays in software development mainly focus on a quality product. So that software testing is a big role in software development. In the development basically software development life cycle. Software testing is a big role and a real challenge to tester as well as developer.
Unit Testing is done by the developer. In .net several frameworks using for unit testing. MSTest, Nunit, and Xunit framework using for writing Unit test cases. Nunit and Xunit third-party framework and MSTest are available in visual studio.
Follow the instruction to create the First MSTest unit test tutorial for beginners.
1.Create a project in visual studio
Create class library projects in the visual studio.
2.Adding class method in class lib file. Please refer to the below image to create a class.
3 Adding Unit Test project same solution
Right click on solution -> Add new project-> Select Test in left menu-> Select unit test project.
4.Click references in the unit test project and add solution project means to refer to the class library project.
5. In test cases Arrange-Act-Assert is a simple and great way to structure test cases.
Arrange-Input and Targets. Arrange step should be set up the inputs.
Act-It should be target behavior. Act the main thing cover what would be testing.
Assert- Checking expected outcome.
Want to learn about Grouping and Filtering Unit Test
ConversionConversion EmoticonEmoticon