Click here to Skip to main content
15,885,100 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I want to start writing a unit test case. From where should i start and what all should i keep in mind while creating one. What are the essential fields needed for writing a unit test case?
Posted

1 solution

Hello gokulkmp ,

Unit test cases is purely depend upon the method functionality you need to test.
Like say if you are testing Calculation method (which is user defined function) and functionality of that method is like It will add "A" and "B" and give output as "AB"

so tester would write unit test case
1) call the calculation method and pass "A" as first parameter and "B" as second parameter
2) store output of this method into variable and check that with expected output as 'AB' if it pass then mark test case as pass other wise fail.

There are predefined variable used like "Assert.Pass" / "Assert.Fail"

Please read this

How to write Unit Test cases using VSTS[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900