public void WhereTheItemAtPositionIsGreaterThanValue_WithNotExistentItemInPosition_ShouldThrowException() { int[] array = { 1, 2, 3 }; int index = 3; Action act = () => IsAnEnumerable <int> .WhereTheItemAtPosition(index, IsGreaterThan.Value(2)).Evaluate(array); act.Should().Throw <ScreenplayException>() .WithMessage($"Index {index} is out of range for the IEnumerable<{typeof(int)}> with count {array.Count()}"); }
public void WhereTheItemAtPositionIsEqualToValue_WithNegativePosition_ShouldThrowException() { int[] array = { 1, 2, 3 }; int index = -1; Action act = () => IsAnEnumerable <int> .WhereTheItemAtPosition(index, IsEqualTo.Value(1)).Evaluate(array); act.Should().Throw <ScreenplayException>() .WithMessage($"Index {index} is out of range for the IEnumerable<{typeof(int)}> with count {array.Count()}"); }
public void WhereTheItemAtPositionIsGreaterThanValue_WithItemAtPositionNotGreater_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheItemAtPosition(1, IsGreaterThan.Value(2)).Evaluate(array).Should().BeFalse(); }
public void WhereTheItemAtPositionIsEqualToValue_WithItemAtPositionNotEqual_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheItemAtPosition(2, IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse(); }