Exemplo n.º 1
0
        public void WhenParameterAttributeIsConverted_ThenAdapterParameterHasConvertedAttribute()
        {
            var p     = ParamSettings.WithName("x");
            var pAtts = p.Attributes;

            Spec.SpecifyMethod()
            .WithFunctionSignature <int, int, int>(nameof(CustomizedParameterShouldModel.Sum), p);
            IAdapter <CustomizedParameterShouldModel> adapter = null;
            var attributeTester = new AttributeTester <ParameterInfo>(
                () => { },
                () => pAtts,
                () => adapter = Spec.Finish().Create(null),
                () => adapter.GetType().GetMethod(nameof(CustomizedParameterShouldModel.Sum)).GetParameters()[0],
                pi => pi.GetCustomAttributes());

            attributeTester.TestConvertingAttribute();
        }
Exemplo n.º 2
0
 public void GivenType_WhenAttributeIsConverted_AdapterHasConvertedAttribute()
 {
     AttributeTesterViaType.TestConvertingAttribute();
 }