public override object GetValue(IBuilderContext context) { DependencyResolutionLocatorKey key = new DependencyResolutionLocatorKey(typeof(ITraceSourceCatalogService), null); ITraceSourceCatalogService svc = (ITraceSourceCatalogService)context.Locator.Get(key); return(svc != null?svc.GetTraceSource(sourceName) : null); }
public void TraceSourceIsInjected() { WorkItem container = new TestableRootWorkItem(); ITraceSourceCatalogService ts = container.Services.Get <ITraceSourceCatalogService>(); TestEventTopic topic = new TestEventTopic(); workItem.EventTopics.Add(topic); Assert.IsFalse(String.IsNullOrEmpty(topic.TraceSourceName)); }