Using() modifier missing on NUnit.Framework.Contains.Item()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit V2 |
Fix Released
|
Medium
|
Charlie Poole |
Bug Description
There is a Using() modifier on NUnit.Framework
Make CollectionItems
< public abstract class CollectionItems
< {
< private NUnitEqualityCo
-------
> public abstract class CollectionItems
> {
> protected NUnitEqualityCo
Add the Using modifier to CollectionConta
> /// <summary>
> /// Flag the constraint to use the supplied Comparison object.
> /// </summary>
> /// <param name="comparer">The Comparison<T> object to use.</param>
> /// <returns>
> public CollectionConta
> {
> this.comparer.
> return this;
> }
Variants go similar.
Narrow the return type of Contains.Item() so the new modifier becomes accessible:
> /// <summary>
> /// Creates a new CollectionConta
> /// </summary>
> /// <param name="item">The item that should be found.</param>
> /// <returns>A new CollectionConta
> public static CollectionConta
> {
> return new CollectionConta
> }
Call the supplied comparer at the appropriate time. I suggest that this should be first after comparing for null and reference equality, since it is an explicit override in the test code:
> public bool ObjectsEqual(object x, object y)
> {
...
> if (object.
> return true;
>
> if (externalComparer != null)
> return externalCompare
>
> Type xType = x.GetType();
> Type yType = y.GetType();
>
> if (xType.IsArray && yType.IsArray && !compareAsColle
> return ArraysEqual(
Related branches
description: | updated |
tags: | added: feature |
Changed in nunitv2: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Charlie Poole (charlie.poole) |
milestone: | none → 2.5.9 |
Changed in nunitv2: | |
status: | Confirmed → Triaged |
Changed in nunitv2: | |
status: | Triaged → Fix Committed |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
So, it appears that CollectionConta insConstraint already has Using modifier, which it inherits from CollectionItems EqualConstraint .
Do you have a particular case that isn't working?