Pragmatic Unit Testing in C# with NUnit, 2nd Ed.
While developing any .net application Unit testing is an essential technique because it provides real-world, real-time feedback for developers. This improved confidence in our code, decrease debugging time. NUnit is an open source unit testing framework for Microsoft .NET. NUnit that is available for free download. You can download lattest version of NUnit from http://www.nunit.com/index.php?p=download
"Pragmatic Unit Testing in C# with NUnit, Second Edition", written by Andy Hunt and Dave Thomas with Matt Hargett; is the C# edition of the second volume in the Pragmatic Starter Kit series that divided into 10 chapters and four appendixes.
Unit testing is a relatively inexpensive, easy way to produce better and faster code. But there are several questions... Why, What, How, Where, when... blab blab blab! Considering such question first chapter of this book going to introduce us with Unit testing and it's important.
Then we are going for planning our First Unit Tests to check whether code is behaving as we expect. Here we get introduce with Nunit testing environment and configure it for Writing Tests in NUnit.
With further reading through book we get introduce with acronyms BICEP, CORRECT which are not other than (you may say) rules to test application in efficient way.
If your code has dependencies with database, network or external systems which are not within your control, will cause issues. We can use things like mock objects to represent network and database failures to emulate them. Instead of testing against the real code itself, A mock object is simply a testing replacement for a real-world object. A number of situations can come up where mock objects can help us. Here we gat idea about how and where to use Mock and When Not to use Mock.
Unit tesing is useful and if used badly, they can cause an enormous amount of damage to a project by wasting time. To avoid it author introduce us with a rule "A TRIP". This helps to explain how to design and test your real world projects to improve the design and architecture of your code with Test-driven Design and development approach. Then we move on UI testing shows you how to do unit testing on WinForms, Web UIs, Programmer UIs and Command-line UIs.
This book contains 4 appendices focused on issues, problems and misconceptions that every developer faced while doing real time development. Some good resources help us to upgrade our knowledge. And answer to all the Exercises in the book.
This book is focused on NUnit and C#, but the theory and logic is just as useful in pretty much any language you use. I like to recommend this book to all enthusiastic developer and programmer who love to develop quality code.
Title: Pragmatic Unit Testing in C# with NUnit, 2nd Ed.
Authors: Andy Hunt, Dave Thomas with Matt Hargett
Publisher: The Pragmatic Bookshelf
Paperback: 176 pages
ISBN 10: 0-9776166-7-3
ISBN 13: 978-1-59327-173-2
Product Dimensions: 8.8 x 7.5 x 0.8 inches