public void WithLambda() { var source = new None(); var result = source.Match(none => 1); Assert.Equal(1, result); }
public void WithMethodReference() { int Match(None none) => 1; var source = new None(); var result = source.Match(Match); Assert.Equal(1, result); }
public void WithLambda() { var invocations = 0; var source = new None(); source.Match(() => { invocations++; }); Assert.Equal(1, invocations); }
public void WithMethodReference() { var invocations = 0; void Match() => invocations++; var source = new None(); source.Match(Match); Assert.Equal(1, invocations); }