예제 #1
0
        public void PArrayDefaultBehavior_can_apply_default_behavior_to_return_default_value_against_one_type()
        {
            // Arrange
            PArray.
            ExcludeGeneric().
            IncludeExistsOfTTArrayPredicateOfT <int>().
            DefaultBehavior = IndirectionBehaviors.DefaultValue;


            // Act
            var get_now = PDateTime.NowGet().Body;
            var exists  = PArray.ExistsOfTTArrayPredicateOfT <int>().Body;


            // Assert
            Assert.IsNull(get_now);
            Assert.IsFalse(exists(null, null));
        }
예제 #2
0
        public void PArrayDefaultBehavior_can_apply_default_behavior_to_throw_NotImplementedException_against_one_type()
        {
            // Arrange
            PArray.
            ExcludeGeneric().
            IncludeExistsOfTTArrayPredicateOfT <int>().
            DefaultBehavior = IndirectionBehaviors.NotImplemented;


            // Act
            var get_now = PDateTime.NowGet().Body;
            var exists  = PArray.ExistsOfTTArrayPredicateOfT <int>().Body;


            // Assert
            Assert.IsNull(get_now);
            Assert.Throws <NotImplementedException>(() => exists(null, null));
        }