public void InstancesWithMadeUpNameWillBeAttachedToTheirInstrumentationListeners() { DictionaryConfigurationSource configSource = new DictionaryConfigurationSource(); configSource.Add(InstrumentationConfigurationSection.SectionName, new InstrumentationConfigurationSection(true, true, true)); MockBuilderContext context = new MockBuilderContext(); context.Policies.AddPolicies(GetPolicies(configSource)); InstrumentationStrategy strategy = new InstrumentationStrategy(); MadeUpNamedSource namedSource = new MadeUpNamedSource(); MadeUpNamedSource createdObject = strategy.BuildUp <MadeUpNamedSource>(context, namedSource, ConfigurationNameProvider.MakeUpName()); Assert.IsTrue(createdObject.IsWired); }
public void InstancesWithNoNameWillBeAttachedToTheirInstrumentationListeners() { DictionaryConfigurationSource configSource = new DictionaryConfigurationSource(); configSource.Add(InstrumentationConfigurationSection.SectionName, new InstrumentationConfigurationSection(true, true, true, "fooApplicationInstanceName")); UnnamedSource source = new UnnamedSource(); BuilderContext context = new BuilderContext( new StrategyChain(), null, null, new PolicyList(GetPolicies(configSource)), NamedTypeBuildKey.Make <UnnamedSource>(), source); InstrumentationStrategy strategy = new InstrumentationStrategy(); strategy.PreBuildUp(context); Assert.IsTrue(((UnnamedSource)context.Existing).IsWired); }
public InstrumentatorParameters(ModuleDefinition dependencyMonitor, TestingFrameworkType testingFrameworkType, InstrumentationStrategy strategy, DependencyMonitor.InstrumentationArguments instrumentationArgsType, bool instrumentAtMethodBeginning) { this.DependencyMonitor = dependencyMonitor; this.TestingFrameworkType = testingFrameworkType; this.Strategy = strategy; this.InstrumentationArgsType = instrumentationArgsType; this.InstrumentAtMethodBeginning = instrumentAtMethodBeginning; }