Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.84 KB

named-tuples.md

File metadata and controls

49 lines (40 loc) · 1.84 KB

Named Tuples

Instances of named tuples can be verified.

Due to the use of ITuple, this approach is only available an net472+ and netcoreapp2.2+.

Given a method that returns a named tuple:

static (bool Member1, string Member2, string Member3) MethodWithNamedTuple()
{
    return (true, "A", "B");
}

snippet source | anchor

Can be verified:

await VerifyTuple(() => MethodWithNamedTuple());

snippet source | anchor

Resulting in:

{
  Member1: true,
  Member2: A,
  Member3: B
}

snippet source | anchor