Creating Unit tests for your c# code - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Tuesday, June 12, 2012

Creating Unit tests for your c# code

Introduction

When we are creating a C# library (API consumed by other applications) we are not sure what could be the possible uses of it by the application developer. They may pass incorrect argument information to our API functions. To validate all the scenarios we need to create code that will check and validate our API methods.

Sometimes we need to modify our methods and we do not have time to do smoke testing. In such scenarios, if we have an Automated Unit Test then we can easily check if anything breaks. To successfully validate our methods/Class, we need to achieve more code coverage for our code.

Using the code  


Here we will see how our code could be tested using a Unit Test Framework. I have created a sample method for explaining the testing framework. Check the below API method.


Read More...


I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too. 

Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.


No comments:

Post a Comment