public void Single_With_Multiple_Must_Return_None(int[] source) { // Arrange var wrapped = Wrap .AsValueEnumerable(source); // Act var result = ValueEnumerableExtensions .Single <Wrap.ValueEnumerableWrapper <int>, Wrap.Enumerator <int>, int>(wrapped); // Assert _ = result.Must() .BeOfType <Option <int> >() .EvaluateTrue(option => option.IsNone); }
public void Single_With_Single_Must_Return_Some(int[] source) { // Arrange var wrapped = Wrap .AsValueEnumerable(source); var expected = Enumerable .Single(source); // Act var result = ValueEnumerableExtensions .Single <Wrap.ValueEnumerableWrapper <int>, Wrap.Enumerator <int>, int>(wrapped); // Assert _ = result.Match( value => value.Must().BeEqualTo(expected), () => throw new Exception()); }