Date post: | 15-Apr-2017 |
Category: |
Documents |
Upload: | sayedur-rahman |
View: | 164 times |
Download: | 0 times |
Bordas Shop
Unit Tests27th October 2013
Objective
Automated testTest for core methods onlyIntegrated with Jenkins
Build success only if all test success
Total 496 test cases for 6 core methods
Testing Framework – NUnit
Version 2.6Written entirely in C#Many advantages of .NET.
E.g. custom attributes and reflection.
Jenkins NUnit Plugin for build automationNUnit = xUnit of .NET languagesFree
Change of plan
VisualStudioUnit
TestingFramework
NUnit
Naming
Roy osherovAuthor of “Art of unit testing”blog “Naming standards for unit tests”
[UnitOfWork_StateUnderTest_ExpectedBehavior]GetProducts_Availability_NotNullExpected
GetProducts_CheckPriceLessThanOrEqualZero_CountZeroExpected
GetStreet_CheckDuplicateId_InputPostCode1113_CountZeroExpected
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 AArrange, Act, Assert
Sample test case 1Check by different combination
Sample test case 2Don’t miss boundary values
Sample test case 3Make sure exception is thrown where is should
NUnit
Jenkins
Goals
Glitch free methods Tested methods Fully functional methods Tension free modificationA form of documentation. Confidence
Demonstration
Q & A
Thank you