public void WhereTheItemAtPositionIsEqualToValue_WithJustOneItemAndNotExistentItemInPosition_ShouldThrowException()
        {
            int[]  array = { 1 };
            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()}");
        }
예제 #2
0
 public void String_Actual_Null_False()
 {
     IsEqualTo.Value("something").Evaluate(null).Should().BeFalse();
 }
예제 #3
0
 public void String_Null_True()
 {
     IsEqualTo <string> .Value(null).Evaluate(null).Should().BeTrue();
 }
예제 #4
0
 public void String_False()
 {
     IsEqualTo.Value("hello").Evaluate("goodbye").Should().BeFalse();
 }
예제 #5
0
 public void String_True()
 {
     IsEqualTo.Value("hello").Evaluate("hello").Should().BeTrue();
 }
예제 #6
0
 public void Int_False()
 {
     IsEqualTo.Value(1).Evaluate(2).Should().BeFalse();
 }
예제 #7
0
 /// <summary>
 /// Builder method to avoid requiring type generic in the fluent call.
 /// </summary>
 /// <typeparam name="TValue">The expected value type.</typeparam>
 /// <param name="expected">The expected value.</param>
 /// <returns></returns>
 public static IsNot <TValue> Value <TValue>(TValue expected) => IsNot <TValue> .Condition(IsEqualTo <TValue> .Value(expected));
예제 #8
0
 public void WhereAtLeastOneItemIsEqualToValue_WithAllItemsEqual_ShouldBeTrue()
 {
     int[] array = { 1, 1, 1 };
     IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeTrue();
 }
예제 #9
0
 /// <summary>
 /// Builder method to avoid requiring type generic in the fluent call.
 /// </summary>
 /// <returns></returns>
 public static IsEqualTo <bool> True() => IsEqualTo <bool> .Value(true);
예제 #10
0
 /// <summary>
 /// Builder method to avoid requiring type generic in the fluent call.
 /// </summary>
 /// <typeparam name="TValue">The expected value type.</typeparam>
 /// <param name="expected">The expected value.</param>
 /// <returns></returns>
 public static IsEqualTo <TValue> Value <TValue>(TValue expected) => IsEqualTo <TValue> .Value(expected);
예제 #11
0
 /// <summary>
 /// Builder method to avoid requiring type generic in the fluent call.
 /// </summary>
 /// <returns></returns>
 public static IsEqualTo <bool> False() => IsEqualTo <bool> .Value(false);
예제 #12
0
 public void WhereTheLastItemIsEqualToValue_WithLastItemEqual_ShouldBeTrue()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheLastItem(IsEqualTo.Value(3)).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 String_Expected_Null_False()
 {
     IsEqualTo <string> .Value(null).Evaluate("something").Should().BeFalse();
 }
예제 #15
0
 public void WhereCountIsEqualToValue_WithHasSizeNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheCount(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }
예제 #16
0
 public void WhereTheFirstItemIsEqualToValue_WithFirstItemNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheFirstItem(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }
예제 #17
0
 public void Int_True()
 {
     IsEqualTo.Value(1).Evaluate(1).Should().BeTrue();
 }
예제 #18
0
 public void WhereAtLeastOneItemIsEqualToValue_WithNoItemsEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(4)).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();
 }