public void AddComposedInterfaces_NonGeneric() { _classBuilderMock.Expect(mock => mock.AddComposedInterfaces(typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2))) .CallOriginalMethod(OriginalCallOptions.CreateExpectation); _classBuilderMock.Expect(mock => mock.AddComposedInterface(typeof(BT2Mixin1))).Return(_classBuilderMock); _classBuilderMock.Expect(mock => mock.AddComposedInterface(typeof(BT3Mixin1))).Return(_classBuilderMock); _classBuilderMock.Expect(mock => mock.AddComposedInterface(typeof(BT3Mixin2))).Return(_classBuilderMock); _mockRepository.Replay(_classBuilderMock); Assert.That(_classBuilderMock.AddComposedInterfaces(typeof(BT2Mixin1), typeof(BT3Mixin1), typeof(BT3Mixin2)), Is.SameAs(_classBuilderMock)); _mockRepository.Verify(_classBuilderMock); }
public void BuildContext_NoInheritance() { _classBuilder.AddMixins <BT1Mixin1, BT1Mixin2>(); _classBuilder.AddComposedInterfaces <IBT6Mixin1, IBT6Mixin2>(); ClassContext builtContext = _classBuilder.BuildClassContext(); Assert.That(builtContext.Mixins.Count, Is.EqualTo(2)); Assert.That(builtContext.Mixins.ContainsKey(typeof(BT1Mixin1)), Is.True); Assert.That(builtContext.Mixins.ContainsKey(typeof(BT1Mixin2)), Is.True); Assert.That(builtContext.ComposedInterfaces.Count, Is.EqualTo(2)); Assert.That(builtContext.ComposedInterfaces, Has.Member(typeof(IBT6Mixin1))); Assert.That(builtContext.ComposedInterfaces, Has.Member(typeof(IBT6Mixin2))); }