SlideShare a Scribd company logo
NUnit
UT Framework
NUnit Features
Multiple
Assemblies
Categories
Assertions
Configuration
Files
Useful
Test
Cases
Test
Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
Categories
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
When categories are used, only the
tests in the selected categories will be
run.
■ TestFixture Syntax
[TestFixture]
[Category LongRunning“)]
public class Tests
■ Test Syntax
Test]
[Category Long“)]
public void VeryLongTest
Categories Categories
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
In addition to running tests in a single
assembly, NUnit provides support for
tests organized as multiple assemblies
and for creating and running tests as
NUnit Test Projects
Categories
Multiple Assemblies
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
If your application stores settings in
configuration files, NUnit provides
you with the ability to have settings
for your test, which are different
from those used in production.
Categories
Configuration Files
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
You can use many attributes to run
a single test with different
parameters:
■ TestCase
■ A single set of parameters per attribute.
■ Range, Random, Values
■ Multiple simple-typed parameters.
■ TestCaseSource,
ValueSource
■ Use a public property or a void Method to
transfer parameters.
Categories Useful Test
Cases
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
NUnit Provide many types of
assertions:
■ Equality
■ AreEqual, AreNotEqual
■ Identity
■ AreSame, AreNotSame, Contains
■ Condition
■ IsTure, IsFalse, IsNull, IsNaN, IsEmpty,
IsNotEmpty
■ Comparison
■ Greater, Less, IsIsnstanceOf, IsAssignableFrom
■ CustomAsserts
■ That, FluentAssertions
■ Strings, Exceptions, You name it!
Categories
Assertions
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
There are some useful attributes that
affect the test Environment:
■ Ignore & Explicit
■ Both tests will not be run, though Explicit tests
can be ran when you run them yourself
■ Platform
■ used to specify platforms for which a test or
fixture should be run.
■ RequiresThread
■ used to indicate that a test method, class or
assembly should be run on a separate thread
Categories
Test
Environment
Test Environment
Theory
NUnit
Multiple Assemblies
Configuration Files
Useful Test Cases
Assertions
A Theory is a special type of test,
used to verify a general statement
about the system under development:
■ Assume & DataPoint
■ Theories are base on assumptions and
facts(DataPoints), opposing to normal tests that
are based on examples.
■ Assertions
■ If any Assertion fails, the Theory itself fails.
■ If at least some cases pass the
stated assumptions, and there
are no assertion failures or
exceptions, then the Theory passes
Categories
Theory
Test Environment
Theory
Questions?

More Related Content

PPTX
Unit testing with NUnit
PPTX
Unit Testing Using N Unit
PPSX
PPTX
TestNG Session presented in PB
PPT
PPTX
Introduction to JUnit
PDF
Functional Tests Automation with Robot Framework
Unit testing with NUnit
Unit Testing Using N Unit
TestNG Session presented in PB
Introduction to JUnit
Functional Tests Automation with Robot Framework

What's hot (20)

PPT
N Unit Presentation
PPTX
Unit Testing And Mocking
PPTX
Kiểm Thử Junit
PDF
PDF
An Introduction to Unit Test Using NUnit
PPTX
Unit Testing
PDF
What is JUnit? | Edureka
PDF
Đề tài: Xây dựng phần mềm thi, đánh giá câu hỏi, đề thi trắc nghiệm khách quan
PDF
Pairwise testing
PPTX
Test NG Framework Complete Walk Through
PPTX
Test Automation Frameworks: Assumptions, Concepts & Tools
PDF
Katalon: Mobile and Browser-Based Automation | Quality Jam 2018
PPT
Automated Testing vs Manual Testing
PPTX
Angular Unit Testing
PDF
prohuddle-utPLSQL v3 - Ultimate unit testing framework for Oracle
PDF
Ccmtptpm 02 gioithieurup
PDF
005. LAP TRINH C#.pdf
PPS
JUnit Presentation
ODP
Beginners - Get Started With Unit Testing in .NET
PDF
Hướng dẫn sử dụng Selenium ide
N Unit Presentation
Unit Testing And Mocking
Kiểm Thử Junit
An Introduction to Unit Test Using NUnit
Unit Testing
What is JUnit? | Edureka
Đề tài: Xây dựng phần mềm thi, đánh giá câu hỏi, đề thi trắc nghiệm khách quan
Pairwise testing
Test NG Framework Complete Walk Through
Test Automation Frameworks: Assumptions, Concepts & Tools
Katalon: Mobile and Browser-Based Automation | Quality Jam 2018
Automated Testing vs Manual Testing
Angular Unit Testing
prohuddle-utPLSQL v3 - Ultimate unit testing framework for Oracle
Ccmtptpm 02 gioithieurup
005. LAP TRINH C#.pdf
JUnit Presentation
Beginners - Get Started With Unit Testing in .NET
Hướng dẫn sử dụng Selenium ide
Ad

Viewers also liked (20)

PPT
Nunit
PPTX
Introduction to nsubstitute
PDF
How and what to unit test
PDF
What is exactly anti fragile in dev ops - v3
PDF
Nuget is easier than you think and you should be using it as both a consumer ...
PPTX
Using nu get the way you should svcc
PPTX
Using NuGet the way you should - TechDays NL 2014
PDF
טלפונים חכמים ואתם
PDF
Code quality as a built-in process
PPTX
Developing NuGet
PDF
Guice - dependency injection framework
PPTX
1953 and all that. A tale of two sciences (Kitcher, 1984)
PDF
xUnit Test Patterns Chapter 20
PPT
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
PDF
Garbage collected teardown
PPTX
Little productivity tools every developer should use
PDF
מכתב המלצה - לירן פרידמן
PPTX
Negative Testing
PPTX
Roy Osherove TDD From Scratch
PPTX
Unit Testing (C#)
Nunit
Introduction to nsubstitute
How and what to unit test
What is exactly anti fragile in dev ops - v3
Nuget is easier than you think and you should be using it as both a consumer ...
Using nu get the way you should svcc
Using NuGet the way you should - TechDays NL 2014
טלפונים חכמים ואתם
Code quality as a built-in process
Developing NuGet
Guice - dependency injection framework
1953 and all that. A tale of two sciences (Kitcher, 1984)
xUnit Test Patterns Chapter 20
Automated Testing and Continuous Integration for Mobile Apps: Jenkins & Cloud...
Garbage collected teardown
Little productivity tools every developer should use
מכתב המלצה - לירן פרידמן
Negative Testing
Roy Osherove TDD From Scratch
Unit Testing (C#)
Ad

Similar to NUnit Features Presentation (20)

DOCX
Test Driven Development
PDF
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
PPTX
Unit testing
PPTX
An Introduction to Unit Testing
DOCX
What Do You Mean By NUnit
PPTX
Skillwise Unit Testing
PPT
Paper PsUpload
PPT
justin presentation upload PPT june 19
PPT
justin presentation Slideshare PPT upload June 25 Final one
PPT
Justin Presentation PPT Upload June 25 adv
PPT
justin for ppt1 by browse button
PPT
upload ppt by browse button
PPT
upload ppt by browse button
PPT
Paper Ps
PPT
Paper Ps
PPT
Paper Ps
PPT
Paper CS
PPT
alkatest7
PPT
alka ppt upload no code change
PPT
upload ppt1 by browse button
Test Driven Development
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Unit testing
An Introduction to Unit Testing
What Do You Mean By NUnit
Skillwise Unit Testing
Paper PsUpload
justin presentation upload PPT june 19
justin presentation Slideshare PPT upload June 25 Final one
Justin Presentation PPT Upload June 25 adv
justin for ppt1 by browse button
upload ppt by browse button
upload ppt by browse button
Paper Ps
Paper Ps
Paper Ps
Paper CS
alkatest7
alka ppt upload no code change
upload ppt1 by browse button

Recently uploaded (20)

PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Pre independence Education in Inndia.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Institutional Correction lecture only . . .
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Business Ethics Teaching Materials for college
PPTX
Cell Structure & Organelles in detailed.
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Pre independence Education in Inndia.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Insiders guide to clinical Medicine.pdf
Pharma ospi slides which help in ospi learning
Final Presentation General Medicine 03-08-2024.pptx
TR - Agricultural Crops Production NC III.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
human mycosis Human fungal infections are called human mycosis..pptx
VCE English Exam - Section C Student Revision Booklet
Institutional Correction lecture only . . .
Module 4: Burden of Disease Tutorial Slides S2 2025
Business Ethics Teaching Materials for college
Cell Structure & Organelles in detailed.
PPH.pptx obstetrics and gynecology in nursing
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
STATICS OF THE RIGID BODIES Hibbelers.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx

NUnit Features Presentation

  • 3. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions Categories Test Environment Theory
  • 4. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions When categories are used, only the tests in the selected categories will be run. ■ TestFixture Syntax [TestFixture] [Category LongRunning“)] public class Tests ■ Test Syntax Test] [Category Long“)] public void VeryLongTest Categories Categories Test Environment Theory
  • 5. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions In addition to running tests in a single assembly, NUnit provides support for tests organized as multiple assemblies and for creating and running tests as NUnit Test Projects Categories Multiple Assemblies Test Environment Theory
  • 6. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions If your application stores settings in configuration files, NUnit provides you with the ability to have settings for your test, which are different from those used in production. Categories Configuration Files Test Environment Theory
  • 7. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions You can use many attributes to run a single test with different parameters: ■ TestCase ■ A single set of parameters per attribute. ■ Range, Random, Values ■ Multiple simple-typed parameters. ■ TestCaseSource, ValueSource ■ Use a public property or a void Method to transfer parameters. Categories Useful Test Cases Test Environment Theory
  • 8. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions NUnit Provide many types of assertions: ■ Equality ■ AreEqual, AreNotEqual ■ Identity ■ AreSame, AreNotSame, Contains ■ Condition ■ IsTure, IsFalse, IsNull, IsNaN, IsEmpty, IsNotEmpty ■ Comparison ■ Greater, Less, IsIsnstanceOf, IsAssignableFrom ■ CustomAsserts ■ That, FluentAssertions ■ Strings, Exceptions, You name it! Categories Assertions Test Environment Theory
  • 9. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions There are some useful attributes that affect the test Environment: ■ Ignore & Explicit ■ Both tests will not be run, though Explicit tests can be ran when you run them yourself ■ Platform ■ used to specify platforms for which a test or fixture should be run. ■ RequiresThread ■ used to indicate that a test method, class or assembly should be run on a separate thread Categories Test Environment Test Environment Theory
  • 10. NUnit Multiple Assemblies Configuration Files Useful Test Cases Assertions A Theory is a special type of test, used to verify a general statement about the system under development: ■ Assume & DataPoint ■ Theories are base on assumptions and facts(DataPoints), opposing to normal tests that are based on examples. ■ Assertions ■ If any Assertion fails, the Theory itself fails. ■ If at least some cases pass the stated assumptions, and there are no assertion failures or exceptions, then the Theory passes Categories Theory Test Environment Theory

Editor's Notes

  • #2: Today We will talk about the features and unique aspects of the NUnit Framework.*To those of you who are totally new to NUnit*NUnit is an open source unit testing framework for Microsoft .NET.It serves the same purpose as JUnit does in the Java world, and is one of many programs in the xUnit family.
  • #3: So, except for the basic functionality of the framework (for an example running a test, having a test class/ fixture , etc…) it has some really powerful features.Some of the features are unique to NUnit.Some are also implemented in other frameworks but not as fluent and easy to use as they are in NUnit.In this presentation, I will talk about the most powerful features of the framework.
  • #4: Transition
  • #5: NUnit allows tests to be categorized by topic.Instead of running a test session based on a test fixture, why not run tests by categories?For an example:If I want to run only the tests that test “Edge Case” Issues, and I have categorized the tests as such, I don’t need to add ignore attributes on tests.I will simply need to specify the “Edge Case” Category to be ran and all the other tests will be excluded from the session.It can be either applied on a single test case or a whole test fixture!Plus, it makes the test class more readable if you can nest it under a certain topic.
  • #6: A Brilliant feature is the ability to run tests from multiple assemblies at once.Most of you will not find it that interesting.But! Think of it. You want to check the integration of few components and need to test it.It allows you to run the tests of each component and the integrative test between them all at a single session!
  • #7: This is a feature that also exists in MSTest but the big difference is that NUnit does it better.Faster Reading of Configuration, Better presentation of parameterized tests, and many more advantages.
  • #8: NUnit provides many neat test case sources- whether it’s a single test case, a range of values or simply cases read from an external source.You can read more about it at Luke Wickstead – How To NUnit: Features @ http://lukewickstead.wordpress.com/2013/02/09/howto-nunit-features/
  • #9: One of the more fluent and readable advantages of NUnit is the assertions.NUnit has many types of assertions that allow easy and very easy to understand assertions.There are also some add-ins that allow truly fluent assertionFind out more on Luke Wickstead – How To NUnit: Assertions @ http://lukewickstead.wordpress.com/2013/02/09/howto-nunit-assertions/
  • #10: NUnit also allows you to control the test environment without any need to change the test itself.You may either ignore or decide whether the test should be ran (Ignore and Explicit).You may also choose the platform that the test will be ran at (for list of supported platforms, go to http://www.nunit.org/index.php?p=platform&r=2.2.10)And even require a test to be ran on a different thread so the tests will work in parallel. (default, the tests run on a single thread.)
  • #11: Theories is a very complex issue.Apparently, it seems as the theory is a normal test. But it is a very special test.The theory is based on assumptions and data points that allow you to test a theoretical matter, rather then an actual fact that has examples.NUnit have a really good example for it on their website @ http://nunit.org/index.php?p=theory&r=2.5
  • #12: That’s it for today people!If you want to ask me questions, simply mail me to Shirbr510@gmail.com and write in the subject “NUnit Presentation Questions”Till Next Time, Shir.