SlideShare a Scribd company logo
Bordas Shop
Unit Tests
27th October 2013
Objective
Automated test
Test for core methods only
Integrated with Jenkins
Build success only if all test success
Total 496 test cases for 6 core methods
Testing Framework – NUnit
Version 2.6
Written entirely in C#
Many advantages of .NET.
E.g. custom attributes and reflection.
Jenkins NUnit Plugin for build automation
NUnit = xUnit of .NET languages
Free
Change of plan
Visual
Studio
Unit
Testing
Framework
NUnit
Naming
Roy osherov
Author of “Art of unit testing”
blog “Naming standards for unit tests”
[UnitOfWork_StateUnderTest_ExpectedBehavior]
GetProducts_Availability_NotNullExpected
GetProducts_CheckPriceLessThanOrEqualZero_CountZeroExp
ected
GetStreet_CheckDuplicateId_InputPostCode1113_CountZeroEx
pected
A A A
Arrange: setup everything needed.
Act: Invoke the code under test.
Assert: Specify the pass criteria for the
test, which fails it if not met.
In 2003 William C. Wake blogged about
using Arrange Act Assert pattern in unit
tests.
A A A
Arrange, Act, Assert
Sample test case 1
Check by different combination
Sample test case 2
Don’t miss boundary values
Sample test case 3
Make sure exception is thrown where is should
NUnit
Jenkins
Goals
Glitch free methods
Tested methods
Fully functional methods
Tension free modification
A form of documentation.
Confidence
Demonstration
Q & A
Thank you

More Related Content

What's hot

Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
Lee Englestone
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
Joe Tremblay
 
Junit
JunitJunit
JUnit 5
JUnit 5JUnit 5
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
Adam Stephensen
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
priya_trivedi
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
Onkar Deshpande
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
David Berliner
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
Baskar K
 
Unit testing
Unit testingUnit testing
Unit testing
princezzlove
 
Python unit testing
Python unit testingPython unit testing
Python unit testing
Darryl Sherman
 
Unit testing
Unit testing Unit testing
Unit testing
Mani Kanth
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
Pokpitch Patcharadamrongkul
 
Junit
JunitJunit
What is JUnit? | Edureka
What is JUnit? | EdurekaWhat is JUnit? | Edureka
What is JUnit? | Edureka
Edureka!
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
Bethmi Gunasekara
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
Alessandro Giorgetti
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
Nayanda Haberty
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Scott Leberknight
 

What's hot (20)

Unit testing
Unit testingUnit testing
Unit testing
 
Unit Tests And Automated Testing
Unit Tests And Automated TestingUnit Tests And Automated Testing
Unit Tests And Automated Testing
 
An Introduction to Unit Testing
An Introduction to Unit TestingAn Introduction to Unit Testing
An Introduction to Unit Testing
 
Junit
JunitJunit
Junit
 
JUnit 5
JUnit 5JUnit 5
JUnit 5
 
An introduction to unit testing
An introduction to unit testingAn introduction to unit testing
An introduction to unit testing
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
JUnit- A Unit Testing Framework
JUnit- A Unit Testing FrameworkJUnit- A Unit Testing Framework
JUnit- A Unit Testing Framework
 
Unit and integration Testing
Unit and integration TestingUnit and integration Testing
Unit and integration Testing
 
Beginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NETBeginners - Get Started With Unit Testing in .NET
Beginners - Get Started With Unit Testing in .NET
 
Unit testing
Unit testingUnit testing
Unit testing
 
Python unit testing
Python unit testingPython unit testing
Python unit testing
 
Unit testing
Unit testing Unit testing
Unit testing
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Junit
JunitJunit
Junit
 
What is JUnit? | Edureka
What is JUnit? | EdurekaWhat is JUnit? | Edureka
What is JUnit? | Edureka
 
TestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit TestingTestNG - The Next Generation of Unit Testing
TestNG - The Next Generation of Unit Testing
 
Angular Unit Testing
Angular Unit TestingAngular Unit Testing
Angular Unit Testing
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 

Similar to Unit Test Presentation

Unit testing
Unit testing Unit testing
Unit testing
dubbu
 
Unit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptxUnit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptx
Knoldus Inc.
 
Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit Test
Hieu Le Trung
 
unit test in node js - test cases in node
unit test in node js - test cases in nodeunit test in node js - test cases in node
unit test in node js - test cases in node
Goa App
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
Anatoliy Okhotnikov
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
Hazem Saleh
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
Tao Xie
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
Hazem Saleh
 
Unit testing
Unit testingUnit testing
Unit testing
Murugesan Nataraj
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Software Infrastructure
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing FundamentalsRichard Paul
 
Unit testing in Unity
Unit testing in UnityUnit testing in Unity
Unit testing in Unity
Mikko McMenamin
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
TriTAUG
 
Unit testing
Unit testingUnit testing
Unit testing
Prabhat Kumar
 
Unit testing framework
Unit testing frameworkUnit testing framework
Unit testing framework
Igor Vavrish
 
Unit tests and TDD
Unit tests and TDDUnit tests and TDD
Unit tests and TDD
Roman Okolovich
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studio
Mahdi Esmailoghli
 
Test-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basicsTest-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basics
Oleksii Prohonnyi
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
Pratik Patel
 

Similar to Unit Test Presentation (20)

Unit testing
Unit testing Unit testing
Unit testing
 
Unit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptxUnit Testing in .NET Core 7.0 with XUnit.pptx
Unit Testing in .NET Core 7.0 with XUnit.pptx
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Model For Applying Unit Test
Model For Applying Unit TestModel For Applying Unit Test
Model For Applying Unit Test
 
unit test in node js - test cases in node
unit test in node js - test cases in nodeunit test in node js - test cases in node
unit test in node js - test cases in node
 
Unit testing (eng)
Unit testing (eng)Unit testing (eng)
Unit testing (eng)
 
Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012Efficient JavaScript Unit Testing, May 2012
Efficient JavaScript Unit Testing, May 2012
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
 
Unit testing
Unit testingUnit testing
Unit testing
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Unit Testing Fundamentals
Unit Testing FundamentalsUnit Testing Fundamentals
Unit Testing Fundamentals
 
Unit testing in Unity
Unit testing in UnityUnit testing in Unity
Unit testing in Unity
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
 
Unit testing
Unit testingUnit testing
Unit testing
 
Unit testing framework
Unit testing frameworkUnit testing framework
Unit testing framework
 
Unit tests and TDD
Unit tests and TDDUnit tests and TDD
Unit tests and TDD
 
Testing tools in visual studio
Testing tools in visual studioTesting tools in visual studio
Testing tools in visual studio
 
Test-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basicsTest-driven development & Behavior-driven development basics
Test-driven development & Behavior-driven development basics
 
Getting started with appium
Getting started with appiumGetting started with appium
Getting started with appium
 

Unit Test Presentation