Skip to content

Add an attribute for all possible permutations of values in an array #85

Open
@DoctorKrolic

Description

Example:

[Theory, CombinatorialData]
public void Example([CombinatorialPermutations(new int[] { 1, 2, 3 })] int[] values)
{
    // 1 2 3
    // 1 3 2
    // 2 1 3
    // 2 3 1
    // 3 1 2
    // 3 2 1
}

Same with other types, e.g. strings:

[Theory, CombinatorialData]
public void Example([CombinatorialPermutations(new string[] { "a", "b", "c" })] string[] values)
{
    // "a" "b" "c"
    // "a" "c" "b"
    // "b" "a" "c"
    // "b" "c" "a"
    // "c" "a" "b"
    // "c" "b" "a"
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions