-
Notifications
You must be signed in to change notification settings - Fork 157
Upgrading
This document assumes you are upgrading to NUnit 3.0 from NUnit 2.6 or later. While it's possible to upgrade from an earlier version, you will need to take into account many additional changes in NUnit, which are not described here. If this is your situation, be sure to check the release notes for earlier versions of NUnit as well.
The Breaking Changes page lists missing and changed functionality in NUnit 3.0. You should review this page to see which items are likely to affect your own tests.
In many cases, the items being removed have been deprecated for some time and an alternate approach may already be available in your current release of NUnit. If that is the case, it will probably save you time and effort if you modify the code in your current environment before switching to NUnit 3.0.
For example, NUnit 3.0 no longer supports ExpectedExceptionAttribute. However, preferred alternatives Assert.Throws and the ThrowsConstraint have been available for several years. If you remove the attribute from your tests and use one of the alternatives instead, you can verify that they work in your present environment and they will continue to work after conversion.
Remove references to your old version of NUnit and replace them with references to NUnit 3.0. In the case of NUnitLite executable tests, you will need to reference both the nunit.framework and nunitlite assemblies. Compile your code. It's possible that you will find compiler errors due to breaking changes in NUnit 3.0, which you missed in the prior step. Make the necessary changes until it all works.
Hopefully, you aren't converting tests that were not passing when you started! If all goes well, they will continue to pass under NUnit 3.0. If not, investigate each case and make necessary changes. If something isn't working as advertised, please let us know.
Copyright (c) 2018 The NUnit Project - Licensed under CC BY-NC-SA 4.0
-
NUnit
-
Release Notes
-
License
- Getting Started
- Writing Tests
- Running Tests
- Extending NUnit
- Technical Notes
-
Release Notes
- NUnit Xamarin Runners
- VS Test Adapter
- VS Test Generator
- NUnit Analyzers