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")); }
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")); }
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); }
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); }
private MixinContextOrigin CreateExpectedOrigin(ExtendsAttribute attribute, Type extenderType = null) { return(MixinContextOrigin.CreateForCustomAttribute(attribute, extenderType ?? _extenderType)); }
private MixinContextOrigin CreateExpectedOrigin(MixAttribute attribute) { return(MixinContextOrigin.CreateForCustomAttribute(attribute, _assembly)); }
private MixinContextOrigin CreateExpectedOrigin(UsesAttribute attribute, Type userType = null) { return(MixinContextOrigin.CreateForCustomAttribute(attribute, userType ?? _userType)); }