コード例 #1
0
        public void CreateForCustomAttribute_OnAssembly()
        {
            var origin = MixinContextOrigin.CreateForCustomAttribute(new MixAttribute(typeof(object), typeof(NullMixin)), _someAssembly);

            Assert.That(origin.Kind, Is.EqualTo("MixAttribute"));
            Assert.That(origin.Assembly, Is.EqualTo(_someAssembly));
            Assert.That(origin.Location, Is.EqualTo("assembly"));
        }
コード例 #2
0
        public void CreateForCustomAttribute_OnMemberInfo()
        {
            var origin = MixinContextOrigin.CreateForCustomAttribute(new UsesAttribute(typeof(NullMixin)), typeof(MixinContextOriginTest));

            Assert.That(origin.Kind, Is.EqualTo("UsesAttribute"));
            Assert.That(origin.Assembly, Is.EqualTo(typeof(MixinContextOriginTest).Assembly));
            Assert.That(origin.Location, Is.EqualTo("Remotion.Mixins.UnitTests.Core.Context.MixinContextOriginTest"));
        }
コード例 #3
0
        public void Apply(MixinConfigurationBuilder configurationBuilder, Assembly attributeTarget)
        {
            ArgumentUtility.CheckNotNull("configurationBuilder", configurationBuilder);
            ArgumentUtility.CheckNotNull("attributeTarget", attributeTarget);

            var origin = MixinContextOrigin.CreateForCustomAttribute(this, attributeTarget);

            Apply(configurationBuilder, MixinKind, TargetType, MixinType, origin);
        }
コード例 #4
0
        public void Apply(MixinConfigurationBuilder configurationBuilder, Type attributeTarget)
        {
            ArgumentUtility.CheckNotNull("configurationBuilder", configurationBuilder);
            ArgumentUtility.CheckNotNull("attributeTarget", attributeTarget);

            Type mixinType = CloseOverMixinTypeArguments(attributeTarget);
            var  origin    = MixinContextOrigin.CreateForCustomAttribute(this, attributeTarget);

            Apply(configurationBuilder, MixinKind.Extending, TargetType, mixinType, origin);
        }
コード例 #5
0
 private MixinContextOrigin CreateExpectedOrigin(ExtendsAttribute attribute, Type extenderType = null)
 {
     return(MixinContextOrigin.CreateForCustomAttribute(attribute, extenderType ?? _extenderType));
 }
コード例 #6
0
 private MixinContextOrigin CreateExpectedOrigin(MixAttribute attribute)
 {
     return(MixinContextOrigin.CreateForCustomAttribute(attribute, _assembly));
 }
コード例 #7
0
 private MixinContextOrigin CreateExpectedOrigin(UsesAttribute attribute, Type userType = null)
 {
     return(MixinContextOrigin.CreateForCustomAttribute(attribute, userType ?? _userType));
 }