Nunit

10,857 views
10,577 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
10,857
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Nunit

  1. 1. Dinuka Malinda Peiris MalalanayakeAssociate QA Engineer -Excel Technology Lanka
  2. 2. BACKGROUND What is an Unit testing? About Nunit. “Any Unit Test is better than none” How to do the Unit testing with C#? Nunit Assertion. Nunit Attributes. Best Practice Advantages Disadvantages Similar Products.
  3. 3. WHAT IS AN UNIT TESTING? A unit test is a procedure used to verify that a particular module of source code is working “Any Unit Test is better than none” properly Company wants to achieve three related goals  Faster time-to-market  Higher quality  More flexibility
  4. 4. ABOUT NUNIT. NUnit is an open source unit testing framework for Microsoft.NET. “Any Unit Test is better than none” It serves the same purpose as JUnit does in the Java world, and is one of many in the xUnit family Provide both GUI and Console
  5. 5. HOW TO DO THE UNIT TESTING WITH C#? “Any Unit Test is better than none”
  6. 6. NUNIT ASSERTION Equality Identity “Any Unit Test is better than none” Comparison Condition String
  7. 7. NUNIT ATTRIBUTES Test Fixture Test “Any Unit Test is better than none” Setup Teardown Test Fixture Setup/ Teardown Expected Exception Platform Category Explicit Suite Ignore
  8. 8. BEST PRACTICE No conditional logic – Switch, if No loops “Any Unit Test is better than none” No exception catching Use appropriate method names Informative assertion message Separation per type
  9. 9. ADVANTAGES Fast Test Isolation “Any Unit Test is better than none” Environment Isolation – Use Mock Objects Unit testing gives you a safety net when programmers refactor or add functionality Unit tests can be used as documentation for other programmers Development process becomes more flexible
  10. 10. DISADVANTAGES Unnecessary Unit Tests can lead to considerably high maintenance cost to your overall project “Any Unit Test is better than none”
  11. 11. SIMILAR PRODUCTSProgramming Language Unit Testing ToolJava – J2SE / J2EE JunitJava – J2ME “Any Unit Test is better than none” JMUnitC CUnitC++ CppUnitphp PHPUnitPython PyUnit / py.test

×