SlideShare a Scribd company logo
1 of 28
Unit Testing using NunitIntroduction to Art of Testing Presenter: GauravArora Email: admin@hyderabadtechies.info Note: This presentation is presented with courtesy of HyderabadTechies.info
Topics What is unit testing? Step-by-step Overview What is Nunit? Hands-on using Nunit
What is unit testing? Unit Testing is a way/method by which individual units of source code/application are tested to determine if they are fit for use. In other words, we can say method by which individual test one thing at a time [i.e. units] without touching external sources [DB, external files, libraries etc.]
Who is responsible for testing? Primarily job for Unit Testing is completely for Developers. But, when we talk about Quality or testing then it would be a different answer. ,[object Object]
Everyone who is a team member
Even it’s the responsibility of customer,[object Object]
Helpful in Documentation of requirements,[object Object],[object Object]
What is Nunit? Nunit is unit-testing framework and supports all .Net languages. It has been written entirely in C# [csharp]. Refer - http://www.nunit.org/
Start with Nunit Before start, we need nUnit framework: Download from : http://www.nunit.org/index.php?p=download http://sourceforge.net/projects/nunit/ [after download, install per your choice, not going in details of this chapter here…] For more info : http://www.nunit.org/
Pictorial Flow of Nunit nUnit Dll, exe file  XML file (Optional) Processing details on the GUI or Command prompt Image : showing [Input & Output]
Nunit : two operational flavors Nunit is having two operational modes: ,[object Object],Graphical user interface, nothing to type just click button and check the results. ,[object Object],Console mode, runs from command prompt, you need to write commands and check the results.
Nunit : Hands-on Before this make sure, nunit framework has been downloaded has properly installed at your system. ,[object Object]
Add references to your project
Write Test methods
Run your tests either with GUI or CUI mode,[object Object]
Nunit : Hands-on… BMI Test ,[object Object]
Select a Class Library project [why choose class library, we are creating a separate project for our tests]
Add reference of nunit.framework.dll in your project
Include ‘NUnit.Framework’ namespace in your project,[object Object]
Hands-on: BMI Test-Structure Using TestFixture Attribute Test Class Setup attribute TearDown attribute Test attribute
Hands-on : Points of interest In previous slide we notified : ,[object Object]
Method names are long, defining scenarios
Attribute TestFixture tells the fixture of test class
Method with Setup attribute calls at very first and TearDown calls after every TestMethod, no matters if there will be an exception,[object Object]
Lets take a look on Code!
Nunit : CUI Console mode is one of the modes available of Nunit, lets discuss how to run from command [console window]: The command to execute the exe in console mode is  	nunit-console.exe [filename] [option]
Nunit : CUI - Output
Nunit : CUI - Options *Options /Fixture=STR                    Fixture to test /config=STR                      project configuration to load /XML=STR                         Name of XML output file /transform=STR                name of transform file /xmlConsoledisplay XML to the console /output=STR                     File to receive test output (short :/out=STR)  /err=STR                           File to receive test error output /labels                              Label each test in stdout /include = STR                  list of categories to include /exclude = STR                 list of categories to exclude /noshadow                        disable shadow option /thread                             runs thread on a separate thread /wait                                 waitfor input before closing console window    /nologoDo not display the logo /help                                Display help (short format: /?)

More Related Content

What's hot

소프트웨어 테스팅
소프트웨어 테스팅소프트웨어 테스팅
소프트웨어 테스팅
영기 김
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
SivaprasanthRentala1975
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
Joe Wilson
 

What's hot (20)

소프트웨어 테스팅
소프트웨어 테스팅소프트웨어 테스팅
소프트웨어 테스팅
 
Katalon Studio - A Codeless Automation Tool.pdf
Katalon Studio - A Codeless Automation Tool.pdfKatalon Studio - A Codeless Automation Tool.pdf
Katalon Studio - A Codeless Automation Tool.pdf
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)Test and Behaviour Driven Development (TDD/BDD)
Test and Behaviour Driven Development (TDD/BDD)
 
ISTQB Foundation Level Basic
ISTQB Foundation Level BasicISTQB Foundation Level Basic
ISTQB Foundation Level Basic
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Introduction to Automation Testing
Introduction to Automation TestingIntroduction to Automation Testing
Introduction to Automation Testing
 
Codeless Test Automation - A Webinar Presentation
Codeless Test Automation - A Webinar PresentationCodeless Test Automation - A Webinar Presentation
Codeless Test Automation - A Webinar Presentation
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Making the Transition from Manual to Automated Testing
Making the Transition from Manual to Automated TestingMaking the Transition from Manual to Automated Testing
Making the Transition from Manual to Automated Testing
 
Introduction to Agile Testing
Introduction to Agile TestingIntroduction to Agile Testing
Introduction to Agile Testing
 
Unit Testing
Unit TestingUnit Testing
Unit Testing
 
Unit test
Unit testUnit test
Unit test
 
An Introduction to Test Driven Development
An Introduction to Test Driven Development An Introduction to Test Driven Development
An Introduction to Test Driven Development
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDD
 
Selenium with java
Selenium with javaSelenium with java
Selenium with java
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Unit Testing And Mocking
Unit Testing And MockingUnit Testing And Mocking
Unit Testing And Mocking
 
Automation testing
Automation testingAutomation testing
Automation testing
 

Viewers also liked

Huu Le - Tma Open Source For Project Tools
Huu Le - Tma Open Source For Project ToolsHuu Le - Tma Open Source For Project Tools
Huu Le - Tma Open Source For Project Tools
Mario B.
 
Bai tap testing junit…..
Bai tap testing junit…..Bai tap testing junit…..
Bai tap testing junit…..
Mua Xuong
 
Android Nâng cao-Bài 8-JSON & XML Parsing
Android Nâng cao-Bài 8-JSON & XML ParsingAndroid Nâng cao-Bài 8-JSON & XML Parsing
Android Nâng cao-Bài 8-JSON & XML Parsing
Phuoc Nguyen
 
Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development
Phuoc Nguyen
 
Android Nâng cao-Bài 6-Multi theme-adb tool-jUnit
Android Nâng cao-Bài 6-Multi theme-adb tool-jUnitAndroid Nâng cao-Bài 6-Multi theme-adb tool-jUnit
Android Nâng cao-Bài 6-Multi theme-adb tool-jUnit
Phuoc Nguyen
 
Giáo trình Tester Full
Giáo trình Tester FullGiáo trình Tester Full
Giáo trình Tester Full
Thanh Sơn
 
Bao cao tttn an ninh web
Bao cao tttn   an ninh webBao cao tttn   an ninh web
Bao cao tttn an ninh web
Nhóc Mèo
 

Viewers also liked (17)

Huu Le - Tma Open Source For Project Tools
Huu Le - Tma Open Source For Project ToolsHuu Le - Tma Open Source For Project Tools
Huu Le - Tma Open Source For Project Tools
 
Adp junit
Adp junitAdp junit
Adp junit
 
He thong cong cu kiem thu tu dong va dam bao chat luong phan mem
He thong cong cu kiem thu tu dong va dam bao chat luong phan memHe thong cong cu kiem thu tu dong va dam bao chat luong phan mem
He thong cong cu kiem thu tu dong va dam bao chat luong phan mem
 
Bai tap testing junit…..
Bai tap testing junit…..Bai tap testing junit…..
Bai tap testing junit…..
 
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
Introduction to testing with MSTest, Visual Studio, and Team Foundation Serve...
 
Android Nâng cao-Bài 8-JSON & XML Parsing
Android Nâng cao-Bài 8-JSON & XML ParsingAndroid Nâng cao-Bài 8-JSON & XML Parsing
Android Nâng cao-Bài 8-JSON & XML Parsing
 
Kiểm thử bảo mật web
Kiểm thử bảo mật webKiểm thử bảo mật web
Kiểm thử bảo mật web
 
NUnit Features Presentation
NUnit Features PresentationNUnit Features Presentation
NUnit Features Presentation
 
[Seminar] Hướng dẫn viết test case
[Seminar] Hướng dẫn viết test case[Seminar] Hướng dẫn viết test case
[Seminar] Hướng dẫn viết test case
 
Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development Android Nâng cao-Bài 9-Debug in Android Application Development
Android Nâng cao-Bài 9-Debug in Android Application Development
 
Android Nâng cao-Bài 6-Multi theme-adb tool-jUnit
Android Nâng cao-Bài 6-Multi theme-adb tool-jUnitAndroid Nâng cao-Bài 6-Multi theme-adb tool-jUnit
Android Nâng cao-Bài 6-Multi theme-adb tool-jUnit
 
Slide đồ án kiểm thử PM
Slide đồ án kiểm thử PMSlide đồ án kiểm thử PM
Slide đồ án kiểm thử PM
 
Giáo trình Tester Full
Giáo trình Tester FullGiáo trình Tester Full
Giáo trình Tester Full
 
Đồ án kiểm thử phần mềm
Đồ án kiểm thử phần mềmĐồ án kiểm thử phần mềm
Đồ án kiểm thử phần mềm
 
NUnit vs MSTest
NUnit vs MSTestNUnit vs MSTest
NUnit vs MSTest
 
Nunit framework for .NET application
Nunit framework for .NET applicationNunit framework for .NET application
Nunit framework for .NET application
 
Bao cao tttn an ninh web
Bao cao tttn   an ninh webBao cao tttn   an ninh web
Bao cao tttn an ninh web
 

Similar to Unit Testing Using N Unit

YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
Yury M
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
Mamgmo Magnda
 
Alexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extraAlexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extra
rit2010
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
Prashanth Shivakumar
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester Training
Anna Russo
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
Concentrated Technology
 
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
Anna Russo
 

Similar to Unit Testing Using N Unit (20)

SE2011_10.ppt
SE2011_10.pptSE2011_10.ppt
SE2011_10.ppt
 
Coded ui - lesson 1 - overview
Coded ui - lesson 1 - overviewCoded ui - lesson 1 - overview
Coded ui - lesson 1 - overview
 
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
 
Coded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui testCoded ui - lesson 4 - coded ui test
Coded ui - lesson 4 - coded ui test
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated TestingGame Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
 
Modern Python Testing
Modern Python TestingModern Python Testing
Modern Python Testing
 
Getting started with test complete 7
Getting started with test complete 7Getting started with test complete 7
Getting started with test complete 7
 
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...Testes? Mas isso não aumenta o tempo de projecto? Não quero...
Testes? Mas isso não aumenta o tempo de projecto? Não quero...
 
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14hYuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
YuryMakedonov_GUI_TestAutomation_QAI_Canada_2007_14h
 
Introduction To UnitTesting & JUnit
Introduction To UnitTesting & JUnitIntroduction To UnitTesting & JUnit
Introduction To UnitTesting & JUnit
 
Industrialization of Android Development (Concept)
Industrialization of Android Development (Concept)Industrialization of Android Development (Concept)
Industrialization of Android Development (Concept)
 
Csharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul YaoCsharp Hands On Lab Paul Yao
Csharp Hands On Lab Paul Yao
 
Alexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extraAlexandre.iline rit 2010 java_fxui_extra
Alexandre.iline rit 2010 java_fxui_extra
 
VB.Net GUI Unit_01
VB.Net GUI Unit_01VB.Net GUI Unit_01
VB.Net GUI Unit_01
 
Unit Tests? It is Very Simple and Easy!
Unit Tests? It is Very Simple and Easy!Unit Tests? It is Very Simple and Easy!
Unit Tests? It is Very Simple and Easy!
 
Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)Plug yourself in and your app will never be the same (1 hr edition)
Plug yourself in and your app will never be the same (1 hr edition)
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
 
Improving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester TrainingImproving Software Quality- 2-day Tester Training
Improving Software Quality- 2-day Tester Training
 
Inventory your network and clients with PowerShell
Inventory your network and clients with PowerShellInventory your network and clients with PowerShell
Inventory your network and clients with PowerShell
 
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
STARWEST 2010 - 7 Steps To Improving Software Quality using Microsoft Test Ma...
 

More from Gaurav Arora (6)

Test driven development
Test driven developmentTest driven development
Test driven development
 
ASP NET MVC Series For Beginers Part 2
ASP NET MVC Series For Beginers Part 2ASP NET MVC Series For Beginers Part 2
ASP NET MVC Series For Beginers Part 2
 
ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1ASPNet MVC series for beginers part 1
ASPNet MVC series for beginers part 1
 
Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1Asp net mvc series for beginers part 1
Asp net mvc series for beginers part 1
 
Silverlight Demos For Beginners
Silverlight Demos For BeginnersSilverlight Demos For Beginners
Silverlight Demos For Beginners
 
Wcf Transaction Handling
Wcf Transaction HandlingWcf Transaction Handling
Wcf Transaction Handling
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Unit Testing Using N Unit

  • 1. Unit Testing using NunitIntroduction to Art of Testing Presenter: GauravArora Email: admin@hyderabadtechies.info Note: This presentation is presented with courtesy of HyderabadTechies.info
  • 2. Topics What is unit testing? Step-by-step Overview What is Nunit? Hands-on using Nunit
  • 3. What is unit testing? Unit Testing is a way/method by which individual units of source code/application are tested to determine if they are fit for use. In other words, we can say method by which individual test one thing at a time [i.e. units] without touching external sources [DB, external files, libraries etc.]
  • 4.
  • 5. Everyone who is a team member
  • 6.
  • 7.
  • 8. What is Nunit? Nunit is unit-testing framework and supports all .Net languages. It has been written entirely in C# [csharp]. Refer - http://www.nunit.org/
  • 9. Start with Nunit Before start, we need nUnit framework: Download from : http://www.nunit.org/index.php?p=download http://sourceforge.net/projects/nunit/ [after download, install per your choice, not going in details of this chapter here…] For more info : http://www.nunit.org/
  • 10. Pictorial Flow of Nunit nUnit Dll, exe file XML file (Optional) Processing details on the GUI or Command prompt Image : showing [Input & Output]
  • 11.
  • 12.
  • 13. Add references to your project
  • 15.
  • 16.
  • 17. Select a Class Library project [why choose class library, we are creating a separate project for our tests]
  • 18. Add reference of nunit.framework.dll in your project
  • 19.
  • 20. Hands-on: BMI Test-Structure Using TestFixture Attribute Test Class Setup attribute TearDown attribute Test attribute
  • 21.
  • 22. Method names are long, defining scenarios
  • 23. Attribute TestFixture tells the fixture of test class
  • 24.
  • 25. Lets take a look on Code!
  • 26. Nunit : CUI Console mode is one of the modes available of Nunit, lets discuss how to run from command [console window]: The command to execute the exe in console mode is nunit-console.exe [filename] [option]
  • 27. Nunit : CUI - Output
  • 28. Nunit : CUI - Options *Options /Fixture=STR Fixture to test /config=STR project configuration to load /XML=STR Name of XML output file /transform=STR name of transform file /xmlConsoledisplay XML to the console /output=STR File to receive test output (short :/out=STR) /err=STR File to receive test error output /labels Label each test in stdout /include = STR list of categories to include /exclude = STR list of categories to exclude /noshadow disable shadow option /thread runs thread on a separate thread /wait waitfor input before closing console window /nologoDo not display the logo /help Display help (short format: /?)
  • 29. Nunit : GUI Go to your installed path of nunit framework and from bin folder select ‘nunit.exe’ If you installed nunit from msi package just go to program and select Nunit
  • 30. Nunit : Load Test
  • 31. Nunit : Test Result
  • 32. Lets take a look on Nunit GUI
  • 33.
  • 34. “Test-Driven Development in Microsoft .NET” – James Newkirk
  • 35.