コード例 #1
0
        public void Given()
        {
            var configSource            = new DictionaryConfigurationSource();
            var mockEventSourceProvider = new Mock <IContainerReconfiguringEventSource>();

            var section = new MockSection();

            configSource.Add(SectionName, section);

            var builder = new SectionBuilder();

            builder.LocatorSection()
            .AddConfigSection(SectionName).WithProviderName("MockSectionProvider")
            .AddTo(configSource);

            var eventArgs = new Mock <ContainerReconfiguringEventArgs>(configSource, new[] { SectionName });
            var provider  = TypeRegistrationsProvider.CreateDefaultProvider(configSource, mockEventSourceProvider.Object);

            MockSection.UpdatedRegistrationsWasCalled = false;
            mockEventSourceProvider.Raise(e => e.ContainerReconfiguring += null, eventArgs.Object);
        }
コード例 #2
0
        public void Given()
        {
            var configSource = new DictionaryConfigurationSource();
            var mockEventSourceProvider = new Mock<IContainerReconfiguringEventSource>();

            var section = new MockSection();
            configSource.Add(SectionName, section);

            var builder = new SectionBuilder();
            builder.LocatorSection()
                .AddConfigSection(SectionName).WithProviderName("MockSectionProvider")
                .AddTo(configSource);
          
            var eventArgs = new Mock<ContainerReconfiguringEventArgs>(configSource, new[] { SectionName });
            var provider = TypeRegistrationsProvider.CreateDefaultProvider(configSource, mockEventSourceProvider.Object);

            MockSection.UpdatedRegistrationsWasCalled = false;
            mockEventSourceProvider.Raise(e => e.ContainerReconfiguring += null, eventArgs.Object);
        }