public void IndirectionDelegate_should_return_null_if_same_signature_delegate_is_not_found()
        {
            // Arrange
            var name   = "GetContractDetailsStringBooleanRefDecimalRefDecimalRef";
            var alias  = "GetContractDetailsStringBooleanRefDecimalRefDecimalRef";
            var xml    = string.Empty;
            var target = typeof(ULHelpers).GetMethods().First();
            var stub   = new IndirectionStub(name, alias, xml, target);


            // Act
            var indDlgt = stub.IndirectionDelegate;


            // Assert
            Assert.IsNull(indDlgt);
        }
Example #2
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));
        }
Example #3
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));
        }