opened
jnm2
username_0
Right now I'm not seeing an API that allows this. I would like to be able to write `Contains.Substring("str").Using(StringComparison.OrdinalIgnoreCase)`.
Contains.Substring with custom StringComparison
issue
created
jnm2
username_0
@nunit/framework-team Any objections to adding this to the backlog?
comment
created
CharliePoole
username_1
For an easyfix, I would suggest telling the possible contributor where the fix needs to be made in our source code.
comment
created
CharliePoole
username_1
Although, easyfix for an item not on the backlog means it will show up in searches, possibly confusing people who don't see the pipelines.
comment
created
jnm2
username_0
Yeah, okay. For the time being I won't apply easyfix without it being approved for implementation, even if I think it is an easy fix.
comment
created
ChrisMaddock
username_2
No objection from me
comment
created
rprouse
username_3
Speaking earlier of feature creep, this is one feature that I think could be useful to a wider audience, so I am okay with the idea 👍
comment
created
jnm2
username_0
Also, [`string.Contains(string, StringComparison)` is being added](https://github.com/dotnet/corefx/issues/20846) to .NET Core.
comment
created
jnm2
username_0
Notes for implementers:

[`StringConstraint`](https://github.com/nunit/nunit/blob/master/src/NUnitFramework/framework/Constraints/StringConstraint.cs) needs a `Using(StringComparison)` method, very similar to the `CaseInsensitive` property, and the `Matches` implementation in every subclass needs to use it if specified.
comment
created
jnm2
username_0
Ooh, quick design question that just occurred to me: I think we should throw (and document) an `InvalidOperationException` if you use _both_ `.Using(StringComparison) and `.IgnoreCase` in either order... unless we want to define some fancy rules. Either way what I don't think we should do is have one silenty override the other because it will be misleading to anyone reading the code.
comment
created
CharliePoole
username_1
@username_0 Re design issue: I think we have to do whatever we already do in other classes that allow both `.Using` and `.IgnoreCase`. If we don't it will be very confusing for users.
comment
created
jnm2
username_0
@username_1 I didn't think we had any, but let's follow precedent.
comment
created
CharliePoole
username_1
EqualConstraint, for example, allows both.
comment
created
MhdTlb
username_4
Can I work on this feature?
comment
created
jnm2
username_0
@username_4 Awesome, you are welcome to! Let us know if you need anything.
We'll also send an invitation so you can be assigned to this issue.
comment
created
MhdTlb
username_4
I pushed required changes under new branch username_4/nunit/issue-2195
comment
created
rprouse
username_3
Fixed by #2294
comment
closed
rprouse
username_3
issue