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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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;
 }