// Interesting thing happens here: Unity injects components created // by both MEF and Unity public CoreComponent( [Dependency("MefService3")] IMefService mefService3, ICoreService coreService) { m_MefService3 = mefService3; m_CoreService = coreService; }
public void IServiceProviderExtensions_GetMefServiceOfT_ReturnsServiceT() { // Act IMefService actual = this.serviceProvider.GetMefService <IMefService>(); // Assert actual.Should().NotBeNull(); actual.Should().Be(this.mefServiceInstance); }
public void IServiceProviderExtensions_GetMefServiceOfT_ReturnsServiceT() { // Act IMefService actual = this.serviceProvider.GetMefService <IMefService>(); // Verify Assert.IsNotNull(actual); Assert.AreSame(this.mefServiceInstance, actual); }