Not able to add EnableTestFixtureOrdering to AssemblyInfo.cs file
AutomationSifu opened this issue · 11 comments
When adding the [assembly: EnableTestFixtureOrdering] line to the AssemblyInfo.cs file the using NUnitOrderedTest directive is not being pulled into the file.
I have downloaded the beta release of the NUnitTestOrdering package via NuGet.
I've listed my version numbers below:
NUnit - 3.9.0
NUnitTestOrdering - v1.0.0-beta1
Package Manager Console output below:
I've excluded the ProjectName field.
PM> get-package
Id Versions
NUnit {3.9.0}
NUnitTestOrdering {1.0.0-beta1}
Selenium.Support {3.10.0}
Selenium.WebDriver {3.10.0}
Selenium.WebDriver.ChromeDriver {2.36.0}
Thanks!
Please submit a minimal repro project.
I'm very new to Github. For your request, are you just asking to upload a very small project to Github or are you saying something different?
Yes, the minimum amount of code needed to reproduce the problem. You can add it as an attachment in your comment, or upload it as a repository on Github.
I created a new project with the least amount of libraries/files to reproduce the problem. After installing the NUnit and NUnitTestOrdering packages I can reproduce the issue. One thing I did notice is after installing the NUnitTestOrdering package via Nuget a file automatically created. The file name is EnableTestOrdering.cs. The file includes the following two lines by default: using NUnitTestOrdering.FixtureOrdering; and [assembly:EnableTestOrdering]. The using directive still shows a red line to indicate the directive is not resolved.
I'm unable to upload a project using my work machine. I can create one at home on my personal machine if the need arises. If there is a specific file(s) that could help with the troubleshooting process or a configuration point I can check, I can get the required information. I can also try a different version of NUnit and NUnitTestOrdering libraries, if that helps. Just Let me know how I can help.
Hi Sebazz,
I hope all is well! Checking in to see if there is any additional feedback.
Thanks!
Version numbers:
"NUnit" version="3.7.1" targetFramework="net452"
"NUnitTestOrdering" version="1.0.0-alpha5" targetFramework="net452"
Compiler errors
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'EnableTestOrdering' could not be found (are you missing a using directive or an assembly reference?) sampleProject2 C:...\EnableTestOrdering.cs 3 Active
Error CS0246 The type or namespace name 'EnableTestOrderingAttribute' could not be found (are you missing a using directive or an assembly reference?) sampleProject2 C:...\AssemblyInfo.cs 37 Active
Error CS0246 The type or namespace name 'EnableTestOrdering' could not be found (are you missing a using directive or an assembly reference?) sampleProject2 C:...\AssemblyInfo.cs 37 Active
Error CS0246 The type or namespace name 'NUnitTestOrdering' could not be found (are you missing a using directive or an assembly reference?) sampleProject2 C:...\EnableTestOrdering.cs 1 Active
Error CS0246 The type or namespace name 'EnableTestOrderingAttribute' could not be found (are you missing a using directive or an assembly reference?) sampleProject2 C:...\EnableTestOrdering.cs 3 Active
Hi Sebazzz,
I did some more testing on this item. I created another project on my personal machine and was able to get the using NUnitTestOrdering directive to show up in the project by using version 4.6.1 of the .Net framework. The one issue I'm still having is getting the following assembly reference to resolve in the AssemblyInfo.cs file: [assembly: EnableTestFixtureOrdering].
I have a few quick questions to help make things more clear:
-
Is there a minimum .NET version to be used with the NUnitTestOrdering library?
-
The EnableTestOrdering.cs file is created by default, is this needed for the project?
-
Should the [assembly: EnableTestFixtureOrdering] reference be added to the AssemblyInfo.cs file?
Thanks!
- It indeed requires .NET 4.6 or higher
- It is a quick start, since you usually want that line anyway.
- Not if you have it defined elsewhere
Awesome I was able to get everything working in a sample project without issue. Updating to .NET 4.6 resolved the issue. I was able to get the testfixture order working in a sample project. This item could be closed. Thanks so much for your help!
Alright. Good to hear.