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 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);
        }
Exemplo n.º 3
0
        public void InstancesWithMadeUpNameWillBeAttachedToTheirInstrumentationListeners()
        {
            DictionaryConfigurationSource configSource = new DictionaryConfigurationSource();

            configSource.Add(InstrumentationConfigurationSection.SectionName,
                             new InstrumentationConfigurationSection(true, true, true, "fooApplicationInstanceName"));
            MadeUpNamedSource namedSource = new MadeUpNamedSource();
            BuilderContext    context
                = new BuilderContext(
                      new StrategyChain(),
                      null,
                      null,
                      new PolicyList(GetPolicies(configSource)),
                      NamedTypeBuildKey.Make <MadeUpNamedSource>(ConfigurationNameProvider.MakeUpName()),
                      namedSource);
            InstrumentationStrategy strategy = new InstrumentationStrategy();

            strategy.PreBuildUp(context);
            Assert.IsTrue(((MadeUpNamedSource)context.Existing).IsWired);
        }