protected override void Arrange() { base.Arrange(); var mockLocator = new Mock<ConfigurationSectionLocator>(); mockLocator.Setup(x => x.ConfigurationSectionNames).Returns(new[] { "MockSection" }); base.Container.RegisterInstance(mockLocator.Object); sectionWithInitializableModels = new MockInitializeSection(); sectionWithInitializableModels.Children.Add(new MockInitialzeCollectionElement() { Name = "TestElement" }); sectionWithInitializableModels.Children.Add(new MockInitialzeCollectionElement() { Name = "TestElement2" }); sectionWithInitializableModels.LeafElement = new MockInitializeElement() { }; }
protected override void Arrange() { base.Arrange(); var mockLocator = new Mock <ConfigurationSectionLocator>(); mockLocator.Setup(x => x.ConfigurationSectionNames).Returns(new[] { "MockSection" }); base.Container.RegisterInstance(mockLocator.Object); sectionWithInitializableModels = new MockInitializeSection(); sectionWithInitializableModels.Children.Add(new MockInitialzeCollectionElement() { Name = "TestElement" }); sectionWithInitializableModels.Children.Add(new MockInitialzeCollectionElement() { Name = "TestElement2" }); sectionWithInitializableModels.LeafElement = new MockInitializeElement() { }; }