We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No helpful information to users when tests have duplicate trait attributes
using System; using System.Collections.Generic; using System.Linq; using Xunit; using Xunit.Abstractions; using Xunit.Sdk; namespace Tests { [Category(TestCategory.Async)] public class Tests { [Fact] [Category(TestCategory.Async)] public void Test1() { Assert.True(true); } } public enum TestCategory { Unspecified = 0, Async, } [TraitDiscoverer("Tests.CategoryDiscoverer", "xunittest")] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = true)] public class CategoryAttribute : Attribute, ITraitAttribute { public CategoryAttribute(TestCategory category) { } } public class CategoryDiscoverer : ITraitDiscoverer { public IEnumerable<KeyValuePair<string, string>> GetTraits(IAttributeInfo traitAttribute) { var args = traitAttribute.GetConstructorArguments().ToList(); yield return new KeyValuePair<string, string>(args[0].ToString(), string.Empty); } } }
Warning about duplicate attributes, but test should run
Starting test execution, please wait... Error: The active Test Run was aborted.
The text was updated successfully, but these errors were encountered:
@jeremymeng thanks for reporting this issue. It is fixed with #328. We will take the fix as part of next insertion to dotnet-cli.
Sorry, something went wrong.
No branches or pull requests
Description
No helpful information to users when tests have duplicate trait attributes
Steps to reproduce
Expected behavior
Warning about duplicate attributes, but test should run
Actual behavior
The text was updated successfully, but these errors were encountered: