Skip to content

Commit

Permalink
Add * just in segments, not in dottedPath
Browse files Browse the repository at this point in the history
  • Loading branch information
whymatter committed Feb 17, 2022
1 parent e2dc5d7 commit 6fffb89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Src/FluentAssertions/Common/MemberPath.cs
Expand Up @@ -106,7 +106,9 @@ public bool HasSameParentAs(MemberPath path)
public bool GetContainsSpecificCollectionIndex() => dottedPath.ContainsSpecificCollectionIndex();

private string[] Segments =>
segments ??= dottedPath.Split(new[] { '.', '[', ']' }, StringSplitOptions.RemoveEmptyEntries);
segments ??= dottedPath
.Replace("[]", "[*]")
.Split(new[] { '.', '[', ']' }, StringSplitOptions.RemoveEmptyEntries);

/// <summary>
/// Returns the name of the member the current path points to without its parent path.
Expand Down
Expand Up @@ -25,7 +25,7 @@ public ExcludeMemberByPathSelectionRule(MemberPath pathToExclude)

public void CombinePath(MemberPath nextPath)
{
memberToExclude = memberToExclude.Combine(nextPath, "[*]");
memberToExclude = memberToExclude.Combine(nextPath, "[]");
SetSelectedPath(memberToExclude.ToString());
}

Expand Down

0 comments on commit 6fffb89

Please sign in to comment.