This document summarizes unit testing done for core methods using the NUnit testing framework integrated with Jenkins. It discusses the testing framework used, naming conventions for test cases, the Arrange Act Assert pattern for writing test cases, sample test cases, goals of unit testing, and concludes with a demonstration and Q&A. A total of 496 test cases were written to test 6 core methods.
In this document
Powered by AI
Presentation on Bordas Shop Unit Tests dated 27th October 2013.
Focus on automated testing with 496 test cases for 6 core methods integrated with Jenkins.
Introduction to NUnit 2.6, advantages of .NET and Jenkins NUnit Plugin for automation.
Transitioning to Visual Studio's Unit Testing Framework with NUnit.
Naming standards by Roy Osherov for unit tests emphasizing clarity in test names.
Outline of the AAA pattern for unit testing, introduced by William C. Wake in 2003.
Reiterating the Arrange, Act, Assert pattern essential for structuring unit tests.
Sample test case showcasing the importance of testing combinations.
Highlighting the significance of boundary value analysis in test case design.
Stress on ensuring exceptions are thrown appropriately in unit tests.
Reinforcing the choice of NUnit for conducting unit tests.
Emphasis on Jenkins as a tool for build automation in testing processes.
Objectives include glitch-free, documented, and confidently modified methods.
Demonstration segment to showcase the unit testing process.
Q&A segment to clarify doubts regarding unit testing.
Closure of the presentation with gratitude expressed to the audience.
Objective
Automated test
Test forcore methods only
Integrated with Jenkins
Build success only if all test success
Total 496 test cases for 6 core methods
3.
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
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
6.
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.