コード例 #1
0
        protected override void Arrange()
        {
            base.Arrange();

            var locator = new Mock <ConfigurationSectionLocator>();

            locator.Setup(x => x.ConfigurationSectionNames).Returns(new[] { "testSection" });
            Container.RegisterInstance(locator.Object);

            var section = new ElementForValidation();

            var source = new DesignDictionaryConfigurationSource();

            source.Add("testSection", section);

            SourceModel = Container.Resolve <ConfigurationSourceModel>();
            SourceModel.Load(source);

            Section = SourceModel.Sections.Where(s => s.SectionName == "testSection").Single();
        }