public void GetMixinArray_WithTwoFittingSupplied() { var mixin1 = new NullMixin(); MixinArrayInitializer initializer = CreateInitializer(typeof(NullTarget), typeof(NullMixin)); initializer.CreateMixinArray(new object[] { mixin1, mixin1 }); }
public void ConstructorsAreReplicated5() { var nullMixin = new NullMixin(); var c = ObjectFactory.Create <ClassWithCtors> (ParamList.Create("a"), nullMixin); Assert.That(c.O, Is.EqualTo("a")); Assert.That(Mixin.Get <NullMixin> (c), Is.SameAs(nullMixin)); }
public void GetMixinArray_WithSuppliedMixins() { var mixin1 = new NullMixin(); var mixin3 = new NullMixin3(); MixinArrayInitializer initializer = CreateInitializer(typeof(NullTarget), typeof(NullMixin), typeof(NullMixin2), typeof(NullMixin3)); var mixinArray = initializer.CreateMixinArray(new object[] { mixin1, mixin3 }); Assert.That(mixinArray.Length, Is.EqualTo(3)); Assert.That(mixinArray[0], Is.SameAs(mixin1)); Assert.That(mixinArray[1], Is.InstanceOf(typeof(NullMixin2))); Assert.That(mixinArray[2], Is.SameAs(mixin3)); }
public TargetClassGettingMixinFromCtor() { MixinInstance = Mixin.Get <NullMixin> (this); }