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()}");
        }
Esempio n. 2
0
 public void String_Actual_Null_False()
 {
     IsEqualTo.Value("something").Evaluate(null).Should().BeFalse();
 }
Esempio n. 3
0
 public void String_Null_True()
 {
     IsEqualTo <string> .Value(null).Evaluate(null).Should().BeTrue();
 }
Esempio n. 4
0
 public void String_False()
 {
     IsEqualTo.Value("hello").Evaluate("goodbye").Should().BeFalse();
 }
Esempio n. 5
0
 public void String_True()
 {
     IsEqualTo.Value("hello").Evaluate("hello").Should().BeTrue();
 }
Esempio n. 6
0
 public void Int_False()
 {
     IsEqualTo.Value(1).Evaluate(2).Should().BeFalse();
 }
Esempio n. 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));
Esempio n. 8
0
 public void WhereAtLeastOneItemIsEqualToValue_WithAllItemsEqual_ShouldBeTrue()
 {
     int[] array = { 1, 1, 1 };
     IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeTrue();
 }
Esempio n. 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);
Esempio n. 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);
Esempio n. 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);
Esempio n. 12
0
 public void WhereTheLastItemIsEqualToValue_WithLastItemEqual_ShouldBeTrue()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheLastItem(IsEqualTo.Value(3)).Evaluate(array).Should().BeTrue();
 }
Esempio n. 13
0
 public void WhereEveryItemIsEqualToValue_WithOneItemEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereEveryItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeFalse();
 }
Esempio n. 14
0
 public void String_Expected_Null_False()
 {
     IsEqualTo <string> .Value(null).Evaluate("something").Should().BeFalse();
 }
Esempio n. 15
0
 public void WhereCountIsEqualToValue_WithHasSizeNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheCount(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }
Esempio n. 16
0
 public void WhereTheFirstItemIsEqualToValue_WithFirstItemNotEqual_ShouldBeFalse()
 {
     int[] array = { 1, 2, 3 };
     IsAnEnumerable <int> .WhereTheFirstItem(IsEqualTo.Value(2)).Evaluate(array).Should().BeFalse();
 }
Esempio n. 17
0
 public void Int_True()
 {
     IsEqualTo.Value(1).Evaluate(1).Should().BeTrue();
 }
Esempio n. 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();
 }