Skip to content

Latest commit

 

History

History
47 lines (38 loc) · 1.83 KB

named-tuples.md

File metadata and controls

47 lines (38 loc) · 1.83 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() =>
    (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