public void SuppressMixins_NonGeneric() { _classBuilderMock.Expect(mock => mock.SuppressMixins(typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2))) .CallOriginalMethod(OriginalCallOptions.CreateExpectation); _classBuilderMock.Expect(mock => mock.SuppressMixin(typeof(BT2Mixin1))).Return(_classBuilderMock); _classBuilderMock.Expect(mock => mock.SuppressMixin(typeof(BT3Mixin1))).Return(_classBuilderMock); _classBuilderMock.Expect(mock => mock.SuppressMixin(typeof(BT3Mixin2))).Return(_classBuilderMock); _mockRepository.Replay(_classBuilderMock); Assert.That(_classBuilderMock.SuppressMixins(typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2)), Is.SameAs(_classBuilderMock)); _mockRepository.Verify(_classBuilderMock); }
public void BuildContext_Suppression() { var classContextBuilder = new ClassContextBuilder(_parentBuilderMock, typeof(BaseType2)); classContextBuilder.AddMixins <BT1Mixin1, BT1Mixin2> (); classContextBuilder.SuppressMixins(typeof(IBT1Mixin1), typeof(BT5Mixin1), typeof(BT3Mixin3 <,>)); var inheritedContext = ClassContextObjectMother.Create(typeof(BaseType2), typeof(BT3Mixin1), typeof(BT3Mixin3 <IBaseType33, IBaseType33>)); var parentContext = ClassContextObjectMother.Create(typeof(BaseType2), typeof(BT5Mixin1), typeof(BT5Mixin2)); ClassContext builtContext = classContextBuilder.BuildClassContext(new[] { inheritedContext, parentContext }); Assert.That(builtContext.Mixins.Count, Is.EqualTo(3)); Assert.That(builtContext.Mixins.ContainsKey(typeof(BT3Mixin1)), Is.True); Assert.That(builtContext.Mixins.ContainsKey(typeof(BT5Mixin2)), Is.True); Assert.That(builtContext.Mixins.ContainsKey(typeof(BT1Mixin2)), Is.True); }