コード例 #1
0
        public void ReadSection_with_default_path_returns_instance_when_present_in_config_file()
        {
            var result = sut.ReadSection <MockConfigurationSection>();

            Assert.IsNotNull(result);
        }
コード例 #2
0
 /// <summary>
 /// Gets a type that represents a <see cref="ConfigurationSection"/>.
 /// </summary>
 /// <remarks>
 /// <para>
 /// This method uses the default configuration path, retrieved using
 /// <see cref="M:GetDefaultConfigurationPath{TSection}"/>.
 /// </para>
 /// <para>
 /// If the section is not found at the appropriate configuration path, or if the configuration section found at that
 /// path is not of the requested type then a <c>null</c> reference is returned instead.
 /// </para>
 /// </remarks>
 /// <returns>
 /// The section, or a <c>null</c> reference.
 /// </returns>
 /// <typeparam name='TSection'>
 /// The type of configuration section to retrieve.
 /// </typeparam>
 public static TSection GetSection <TSection>() where TSection : ConfigurationSection
 => readerSingleton.ReadSection <TSection>();
コード例 #3
0
 IDescribesWebDriverFactory GetDescriptionFromConfig()
 => configurationReader.ReadSection <WebDriverFactoryConfigurationSection>();