Skip to content

Contain(IEnumerable<T>, params T[]) lacks because parameter #806

@MJLHThomassen-Eurocom

Description

@MJLHThomassen-Eurocom

The method

public AndConstraint<TAssertions> Contain(IEnumerable<T> expectedItemsList, params T[] additionalExpectedItems);

in the class SelfReferencingCollectionAssertions<T, TAssertions> lacks a string because parameter. Probably because additionalExpectedItems is a params.

Suggestions:

  1. Refactor to:
public AndConstraint<TAssertions> Contain(IEnumerable<T> expectedItemsList, IEnumerable<T>additionalExpectedItems, string because = "", params object[] becauseArgs);

Pro's:

  • Same signature as other methods

Cons:

  • Breaking change
  1. Add:
public AndConstraint<TAssertions> Contain(IEnumerable<T> expectedItemsList, string because ="", params T[] additionalExpectedItems);

Pro's:

  • Non-breaking change

Cons:

  • No params object[] becauseArgs
  • Still does not match other method signatures

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions