コード例 #1
0
        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()}");
        }
コード例 #2
0
        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()}");
        }
コード例 #3
0
 public void WhereAtLeastOneItemIsGreaterThanValue_WithNoItemsGreater_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereAtLeastOneItem(IsGreaterThan.Value(3)).Evaluate(array).Should().BeFalse();
 }
コード例 #4
0
 public void WhereAtLeastOneItemIsEqualToValue_WithNoItemsEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(4)).Evaluate(array).Should().BeFalse();
 }
コード例 #5
0
 public void WhereAtLeastOneItemIsEqualToValue_WithAllItemsEqual_ShouldBeTrue()
 {
     int[] array = { 1, 1, 1 };
     IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeTrue();
 }
コード例 #6
0
 public void WhereTheFirstItemIsGreaterThanValue_WithFirstItemNotGreater_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheFirstItem(IsGreaterThan.Value(1)).Evaluate(array).Should().BeFalse();
 }
コード例 #7
0
 public void WhereTheFirstItemIsEqualToValue_WithFirstItemNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheFirstItem(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }
コード例 #8
0
 public void WhereCountIsGreaterThanValue_WithHasSizeNotGreater_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheCount(IsGreaterThan.Value(3)).Evaluate(array).Should().BeFalse();
 }
コード例 #9
0
 public void WhereCountIsEqualToValue_WithHasSizeNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheCount(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }
コード例 #10
0
 public void WhereTheLastItemIsGreaterThanValue_WithLastItemGreater_ShouldBeTrue()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheLastItem(IsGreaterThan.Value(2)).Evaluate(array).Should().BeTrue();
 }
コード例 #11
0
 public void WhereTheLastItemIsEqualToValue_WithLastItemEqual_ShouldBeTrue()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheLastItem(IsEqualTo.Value(3)).Evaluate(array).Should().BeTrue();
 }
コード例 #12
0
 public void WhereEveryItemIsGreaterThanValue_WithAllItemsGreater_ShouldBeTrue()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereEveryItem(IsGreaterThan.Value(0)).Evaluate(array).Should().BeTrue();
 }
コード例 #13
0
 public void WhereEveryItemIsEqualToValue_WithOneItemEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereEveryItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeFalse();
 }
コード例 #14
0
 public void WhereTheItemAtPositionIsGreaterThanValue_WithItemAtPositionNotGreater_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheItemAtPosition(1, IsGreaterThan.Value(2)).Evaluate(array).Should().BeFalse();
 }
コード例 #15
0
 public void WhereTheItemAtPositionIsEqualToValue_WithItemAtPositionNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheItemAtPosition(2, IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }