Inheritance: System.Configuration.ConfigurationSection
        public void ScheduledJobsWorkerConfigurationLoaderInitialiseWithConfigSectionSucceeds()
        {
            // Arrange
            var username = "******";
            var password = "******";
            var domain = "arbitrary-domain";
            var appclusiveCredentialSection = new AppclusiveCredentialSection();
            appclusiveCredentialSection.Username = username;
            appclusiveCredentialSection.Password = password;
            appclusiveCredentialSection.Domain = domain;
            
            Mock.SetupStatic(typeof(ConfigurationManager));
            Mock.Arrange(() => ConfigurationManager.GetSection(Arg.Is<string>(AppclusiveCredentialSection.SECTION_NAME)))
                .Returns(appclusiveCredentialSection)
                .MustBeCalled();

            Mock.Arrange(() => ConfigurationManager.AppSettings["ExtensionsFolder"])
                .IgnoreInstance()
                .Returns("..\\..\\..\\biz.dfch.CS.Appclusive.Scheduler.Extensions\\bin\\Debug");
            Mock.Arrange(() => ConfigurationManager.AppSettings["PluginTypes"])
                .IgnoreInstance()
                .Returns("*");
            Mock.Arrange(() => ConfigurationManager.AppSettings["UpdateIntervalMinutes"])
                .IgnoreInstance()
                .Returns("0");
            Mock.Arrange(() => ConfigurationManager.AppSettings["ServerNotReachableRetries"])
                .IgnoreInstance()
                .Returns("0");

            var uri = "http://www.example.com/arbitrary-path/";
            var mgmtUriName = "arbitrary-management-uri-name";
            string[] args = { uri, mgmtUriName };
            var sut = new ScheduledJobsWorkerConfigurationLoader();
            
            // Act
            // sut.Initialise() is implicitly called by ScheduledJobsWorkerConfiguration
            var config = new ScheduledJobsWorkerConfiguration(sut, args);

            // Assert
            Mock.Assert(() => ConfigurationManager.GetSection(Arg.Is<string>(AppclusiveCredentialSection.SECTION_NAME)));
            
            Assert.AreEqual(uri, config.Uri.AbsoluteUri);
            Assert.AreEqual(mgmtUriName, config.ManagementUriName);
            Assert.AreEqual(username, config.Credential.UserName);
            Assert.AreEqual(password, config.Credential.Password);
            Assert.AreEqual(domain, config.Credential.Domain);
        }
        public void GettingConfigSectionSucceeds()
        {
            // Arrange
            var configSection = new AppclusiveCredentialSection();
            var configSectionManager = Mock.Create<ConfigSectionManager>(Constructor.Mocked);
            Mock.Arrange(() => configSectionManager.Get(Arg.Is<string>(AppclusiveCredentialSection.SECTION_NAME)))
                .IgnoreInstance()
                .Returns(configSection)
                .MustBeCalled();

            var sut = new AppclusiveCredentialSectionManager();
            
            // Act
            var result = sut.GetSection();
            
            // Assert
            Mock.Assert(configSectionManager);
            Assert.IsNotNull(result);
        }