public void ExistsT_should_throw_NotImplementedException_if_the_behavior_is_set_that() { using (new IndirectionsContext()) { // Arrange PArray. ExcludeGeneric(). IncludeExistsOfTTArrayPredicateOfT <int>(). DefaultBehavior = IndirectionBehaviors.NotImplemented; // Act, Assert Assert.Throws <NotImplementedException>(() => Array.Exists(new int[] { 1, 2, 3 }, x => x == 42)); } }
public void ExistsT_should_behave_as_same_as_original_if_the_behavior_is_set_that() { using (new IndirectionsContext()) { // Arrange PArray. ExcludeGeneric(). IncludeExistsOfTTArrayPredicateOfT <int>(). DefaultBehavior = IndirectionBehaviors.Fallthrough; // Act var result = Array.Exists(new int[] { 1, 2, 3 }, x => x == 2); // Assert Assert.IsTrue(result); } }
public void ExistsT_should_return_default_value_if_the_behavior_is_set_that() { using (new IndirectionsContext()) { // Arrange PArray. ExcludeGeneric(). IncludeExistsOfTTArrayPredicateOfT <int>(). DefaultBehavior = IndirectionBehaviors.DefaultValue; // Act var result = Array.Exists(new int[] { 1, 2, 3 }, x => x == 2); // Assert Assert.IsFalse(result); } }