Test cases in unit testing - C#.NET

What are three test cases you should go through in unit testing?

Following are the three test cases that you should go through in Unit Testing:

1. Positive test cases (correct data, correct output).
2. Negative test cases (broken or missing data, proper handling).
3. Exception test cases (exceptions are thrown and caught properly).

1. Positive test cases (correct data, correct output):

- It is the first form of testing that a tester would perform on an application.

- It is the process of running test scenarios that an end user would run for his use.

- If a test scenario doesn’t need data, then the positive testing would require running the test exactly the manner in which it is supposed to run and hence it ensures that the application is meeting the specifications.

2. Negative test cases (broken or missing data, proper handling):

- It is referred to as error path testing or failure path testing.

- It ensures the stability of the application.

- It is the process of applying as much creativity as possible and validating the application against invalid data.

- Its main purpose is to check if the errors are being shown to the user where its supposed to or handling a bad value more gracefully.
25 C#.Net Interview Questions for Freshers
C#.Net interview questions for freshers - What is an internal modifier?, What are namespaces, and how they are used?, Why are strings in C# immutable?, What is boxing?, How does C# differ from C++?...
What is strong-typing versus weak-typing? Which is preferred? Why?
C#.Net - What is strong-typing versus weak-typing? -.....
What is a PID? How is it useful? - C#.NET
What is a PID? How is it useful? - PID stands for Process Identifier...
Post your comment