Working around method taking precedence over class of the same name #8216
Replies: 2 comments 3 replies
-
These are the features for this situation. There's always a chance to have name conflict in two components. And basically, the one from "near" component does win. Note that you can use the alias like |
Beta Was this translation helpful? Give feedback.
-
In my opinion, just rename it to something else, e.g., |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Background knowledge
NUnit has an abstract class
Has
with static properties likeAll
orSome
. Sample NUnit test code:My Setup
All my test classes extend the following class from an internal NuGet package.
Problem
I get CS0119 if I try to add
Assert.That(new[] { "a", "b" }, Has.All.Match("myRegex"));
to my test class:Possible options:
MyBaseTest
Has
methods inMyBaseTest
Has
asNUnit.Framework
Has
class (e.g.using DoesHave = NUnit.Framework.Has;
)Has
.Question
Is there a feature in C# that will help me work around this problem?
Beta Was this translation helpful? Give feedback.
All reactions