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 WhereAtLeastOneItemIsGreaterThanValue_WithNoItemsGreater_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereAtLeastOneItem(IsGreaterThan.Value(3)).Evaluate(array).Should().BeFalse(); }
public void WhereAtLeastOneItemIsEqualToValue_WithNoItemsEqual_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(4)).Evaluate(array).Should().BeFalse(); }
public void WhereAtLeastOneItemIsEqualToValue_WithAllItemsEqual_ShouldBeTrue() { int[] array = { 1, 1, 1 }; IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeTrue(); }
public void WhereTheFirstItemIsGreaterThanValue_WithFirstItemNotGreater_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheFirstItem(IsGreaterThan.Value(1)).Evaluate(array).Should().BeFalse(); }
public void WhereTheFirstItemIsEqualToValue_WithFirstItemNotEqual_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheFirstItem(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse(); }
public void WhereCountIsGreaterThanValue_WithHasSizeNotGreater_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheCount(IsGreaterThan.Value(3)).Evaluate(array).Should().BeFalse(); }
public void WhereCountIsEqualToValue_WithHasSizeNotEqual_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheCount(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse(); }
public void WhereTheLastItemIsGreaterThanValue_WithLastItemGreater_ShouldBeTrue() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheLastItem(IsGreaterThan.Value(2)).Evaluate(array).Should().BeTrue(); }
public void WhereTheLastItemIsEqualToValue_WithLastItemEqual_ShouldBeTrue() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheLastItem(IsEqualTo.Value(3)).Evaluate(array).Should().BeTrue(); }
public void WhereEveryItemIsGreaterThanValue_WithAllItemsGreater_ShouldBeTrue() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereEveryItem(IsGreaterThan.Value(0)).Evaluate(array).Should().BeTrue(); }
public void WhereEveryItemIsEqualToValue_WithOneItemEqual_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereEveryItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeFalse(); }
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(); }