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()}"); }
public void String_Actual_Null_False() { IsEqualTo.Value("something").Evaluate(null).Should().BeFalse(); }
public void String_Null_True() { IsEqualTo <string> .Value(null).Evaluate(null).Should().BeTrue(); }
public void String_False() { IsEqualTo.Value("hello").Evaluate("goodbye").Should().BeFalse(); }
public void String_True() { IsEqualTo.Value("hello").Evaluate("hello").Should().BeTrue(); }
public void Int_False() { IsEqualTo.Value(1).Evaluate(2).Should().BeFalse(); }
/// <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));
public void WhereAtLeastOneItemIsEqualToValue_WithAllItemsEqual_ShouldBeTrue() { int[] array = { 1, 1, 1 }; IsAnEnumerable <int> .WhereAtLeastOneItem(IsEqualTo.Value(1)).Evaluate(array).Should().BeTrue(); }
/// <summary> /// Builder method to avoid requiring type generic in the fluent call. /// </summary> /// <returns></returns> public static IsEqualTo <bool> True() => IsEqualTo <bool> .Value(true);
/// <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);
/// <summary> /// Builder method to avoid requiring type generic in the fluent call. /// </summary> /// <returns></returns> public static IsEqualTo <bool> False() => IsEqualTo <bool> .Value(false);
public void WhereTheLastItemIsEqualToValue_WithLastItemEqual_ShouldBeTrue() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheLastItem(IsEqualTo.Value(3)).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 String_Expected_Null_False() { IsEqualTo <string> .Value(null).Evaluate("something").Should().BeFalse(); }
public void WhereCountIsEqualToValue_WithHasSizeNotEqual_ShouldBeFalse() { int[] array = { 1, 2, 3 }; IsAnEnumerable <int> .WhereTheCount(IsEqualTo.Value(2)).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 Int_True() { IsEqualTo.Value(1).Evaluate(1).Should().BeTrue(); }
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(); }