Specflow plugin that generates test code with the "global" keyword before the NUnit.Framework namespace
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
specflow-plugin.sln

README.md

SpecFlow NUnit Plugin

This plugin modifies the behavior of the default NUnit and NUnit3 test generator by adding the global keyword to the fully qualified attribute types that it outputs.

For example:

[NUnit.Framework.TestFixtureAttribute()]

becomes

[global::NUnit.Framework.TestFixtureAttribute()]

Why would I want to do this?

If a test project has a default namespace with "NUnit" in the name, then the test code generated by SpecFlow will not compile.

The type or namespace name 'Framework' does not exist in the namespace 'Test.NUnit' (are you missing an assembly reference?)

Cannot resolve symbol 'Framework'

You could resolve this issue by updating the default namespace in the test project to remove NUnit. This is the best option, but it is not always possible. You may have CI scripts that look for NUnit in the namespaces. In this instance, the NUnit2WithGlobalTestGenerator and NUnit3WithGlobalTestGenerator plugins are useful.