public void AddOrderedMixins_NonGeneric_WithoutOrigin() { var expectedOrigin = MixinContextOrigin.CreateForMethod(MethodBase.GetCurrentMethod()); _classBuilderMock.Expect(mock => mock.AddOrderedMixins(expectedOrigin, typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2))).Return(_classBuilderMock); _mockRepository.ReplayAll(); var result = _classBuilderMock.AddOrderedMixins(typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2)); _mockRepository.VerifyAll(); Assert.That(result, Is.SameAs(_classBuilderMock)); }
public void AddOrderedMixins_NonGeneric() { var origin = MixinContextOriginObjectMother.Create(); Assert.That(_classBuilder.AddOrderedMixins(origin, typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2)), Is.SameAs(_classBuilder)); var mixinBuilders = new List <MixinContextBuilder> (_classBuilder.MixinContextBuilders); Assert.That(mixinBuilders.Count, Is.EqualTo(3)); Assert.That(mixinBuilders[0].MixinType, Is.SameAs(typeof(BT2Mixin1))); Assert.That(mixinBuilders[0].Origin, Is.SameAs(origin)); Assert.That(mixinBuilders[0].Dependencies, Is.Empty); Assert.That(mixinBuilders[1].MixinType, Is.SameAs(typeof(BT3Mixin1))); Assert.That(mixinBuilders[1].Origin, Is.SameAs(origin)); Assert.That(mixinBuilders[1].Dependencies, Is.EquivalentTo(new object[] { typeof(BT2Mixin1) })); Assert.That(mixinBuilders[2].MixinType, Is.SameAs(typeof(BT3Mixin2))); Assert.That(mixinBuilders[2].Origin, Is.SameAs(origin)); Assert.That(mixinBuilders[2].Dependencies, Is.EquivalentTo(new object[] { typeof(BT3Mixin1) })); }