You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.175
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
parent
4bdbaf4a88
commit
966bba02bb
@@ -2,64 +2,49 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Configuration.ConfigurationManager", "src\System.Configuration.ConfigurationManager.csproj", "{B7697463-7C98-4462-BA09-67B7BF3842B6}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B65EE71E-2894-45E3-B0FD-FF34118E9F9A} = {B65EE71E-2894-45E3-B0FD-FF34118E9F9A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{6BF3AE2C-3EEE-42F0-8C62-BAAC04AE6897}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
src\Configurations.props = src\Configurations.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{A6D1680E-20AB-4253-AD1F-AACC478A2510}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
ref\Configurations.props = ref\Configurations.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{76C3F1E4-2EA8-4700-A9C0-EFEF909D7983}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
tests\Configurations.props = tests\Configurations.props
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Configuration.ConfigurationManager.Tests", "tests\System.Configuration.ConfigurationManager.Tests.csproj", "{7669C397-C21C-4C08-83F1-BE6691911E88}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6} = {B7697463-7C98-4462-BA09-67B7BF3842B6}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pkg", "pkg", "{CDDB4E69-37E9-4EE9-93A8-0B5DC240AC11}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
pkg\System.Configuration.ConfigurationManager.builds = pkg\System.Configuration.ConfigurationManager.builds
|
||||
pkg\System.Configuration.ConfigurationManager.pkgproj = pkg\System.Configuration.ConfigurationManager.pkgproj
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Configuration.ConfigurationManager", "src\System.Configuration.ConfigurationManager.csproj", "{B7697463-7C98-4462-BA09-67B7BF3842B6}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{FD6AA2B9-56DB-4BCC-85E0-7727506562B0} = {FD6AA2B9-56DB-4BCC-85E0-7727506562B0}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Configuration.ConfigurationManager", "ref\System.Configuration.ConfigurationManager.csproj", "{B65EE71E-2894-45E3-B0FD-FF34118E9F9A}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Configuration.ConfigurationManager", "ref\System.Configuration.ConfigurationManager.csproj", "{FD6AA2B9-56DB-4BCC-85E0-7727506562B0}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
DebugNETCoreAppnetstandardnetstandard|AnyCPU = DebugNETCoreAppnetstandardnetstandard|AnyCPU
|
||||
ReleaseNETCoreAppnetstandardnetstandard|AnyCPU = ReleaseNETCoreAppnetstandardnetstandard|AnyCPU
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Release|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = netstandard-Release|Any CPU
|
||||
{B65EE71E-2894-45E3-B0FD-FF34118E9F9A}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = Debug|Any CPU
|
||||
{B65EE71E-2894-45E3-B0FD-FF34118E9F9A}.DebugNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = Debug|Any CPU
|
||||
{B65EE71E-2894-45E3-B0FD-FF34118E9F9A}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.ActiveCfg = Debug|Any CPU
|
||||
{B65EE71E-2894-45E3-B0FD-FF34118E9F9A}.ReleaseNETCoreAppnetstandardnetstandard|AnyCPU.Build.0 = Debug|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
{FD6AA2B9-56DB-4BCC-85E0-7727506562B0}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
|
||||
{FD6AA2B9-56DB-4BCC-85E0-7727506562B0}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
|
||||
{FD6AA2B9-56DB-4BCC-85E0-7727506562B0}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
|
||||
{FD6AA2B9-56DB-4BCC-85E0-7727506562B0}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6} = {6BF3AE2C-3EEE-42F0-8C62-BAAC04AE6897}
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88} = {76C3F1E4-2EA8-4700-A9C0-EFEF909D7983}
|
||||
{B65EE71E-2894-45E3-B0FD-FF34118E9F9A} = {A6D1680E-20AB-4253-AD1F-AACC478A2510}
|
||||
{7669C397-C21C-4C08-83F1-BE6691911E88} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
|
||||
{B7697463-7C98-4462-BA09-67B7BF3842B6} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
|
||||
{FD6AA2B9-56DB-4BCC-85E0-7727506562B0} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<ItemGroup>
|
||||
<Project Include="System.Configuration.ConfigurationManager.pkgproj" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
|
||||
</Project>
|
||||
@@ -5,7 +5,7 @@
|
||||
<ProjectReference Include="..\ref\System.Configuration.ConfigurationManager.csproj">
|
||||
<SupportedFramework>netcoreapp2.0;net461;$(AllXamarinFrameworks)</SupportedFramework>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\src\System.Configuration.ConfigurationManager.builds" />
|
||||
<ProjectReference Include="..\src\System.Configuration.ConfigurationManager.csproj" />
|
||||
<InboxOnTargetFramework Include="net461" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{FD6AA2B9-56DB-4BCC-85E0-7727506562B0}</ProjectGuid>
|
||||
<!-- UAP10.1 is not yet mapped to netstandard2.0, manually duplicate this ref -->
|
||||
<PackageTargetFramework>netstandard2.0;uap10.1</PackageTargetFramework>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
|
||||
<ItemGroup>
|
||||
<SuppressPackageTargetFrameworkCompatibility Include="uap10.1" />
|
||||
<Compile Include="System.Configuration.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
|
||||
@@ -1,64 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
@@ -220,15 +161,9 @@
|
||||
<data name="Config_base_element_cannot_have_multiple_child_elements" xml:space="preserve">
|
||||
<value>The element <{0}> may only appear once in this section.</value>
|
||||
</data>
|
||||
<data name="Config_base_element_default_collection_cannot_be_locked" xml:space="preserve">
|
||||
<value>Locks on this collection must be placed on the parent object.</value>
|
||||
</data>
|
||||
<data name="Config_base_element_locked" xml:space="preserve">
|
||||
<value>The element '{0}' has been locked in a higher level configuration.</value>
|
||||
</data>
|
||||
<data name="Config_base_expected_enum" xml:space="preserve">
|
||||
<value>Invalid enum value.</value>
|
||||
</data>
|
||||
<data name="Config_base_expected_to_find_element" xml:space="preserve">
|
||||
<value>Expected to find an element.</value>
|
||||
</data>
|
||||
@@ -262,9 +197,6 @@
|
||||
<data name="Config_base_required_attribute_missing" xml:space="preserve">
|
||||
<value>Required attribute '{0}' not found.</value>
|
||||
</data>
|
||||
<data name="Config_base_section_cannot_contain_cdata" xml:space="preserve">
|
||||
<value>The configuration section cannot contain a CDATA element.</value>
|
||||
</data>
|
||||
<data name="Config_base_section_invalid_content" xml:space="preserve">
|
||||
<value>The configuration section cannot contain a CDATA or text element.</value>
|
||||
</data>
|
||||
@@ -316,9 +248,6 @@
|
||||
<data name="Config_client_config_init_error" xml:space="preserve">
|
||||
<value>Configuration system failed to initialize</value>
|
||||
</data>
|
||||
<data name="Config_client_config_init_security" xml:space="preserve">
|
||||
<value>Failed to initialize configuration because we didn't have necessary security requirements.</value>
|
||||
</data>
|
||||
<data name="Config_client_config_too_many_configsections_elements" xml:space="preserve">
|
||||
<value>Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration> element.</value>
|
||||
</data>
|
||||
@@ -340,9 +269,6 @@
|
||||
<data name="Config_empty_lock_attributes_except" xml:space="preserve">
|
||||
<value>The '{0}' attribute cannot be an empty string. {1}="*" may be used to lock all attributes.</value>
|
||||
</data>
|
||||
<data name="Config_empty_lock_attributes_except_effective" xml:space="preserve">
|
||||
<value>The {0}="{1}" is invalid because the attributes have all been locked at a higher level. {2}="*" must be used to lock all attributes.</value>
|
||||
</data>
|
||||
<data name="Config_empty_lock_element_except" xml:space="preserve">
|
||||
<value>The '{0}' attribute cannot be an empty string. {1}="*" may be used to lock all elements.</value>
|
||||
</data>
|
||||
@@ -367,9 +293,6 @@
|
||||
<data name="Config_invalid_boolean_attribute" xml:space="preserve">
|
||||
<value>The property '{0}' must have value 'true' or 'false'.</value>
|
||||
</data>
|
||||
<data name="Config_invalid_configurationsection_constructor" xml:space="preserve">
|
||||
<value>Invalid constructor for ConfigurationSection.</value>
|
||||
</data>
|
||||
<data name="Config_invalid_node_type" xml:space="preserve">
|
||||
<value>Invalid node type.</value>
|
||||
</data>
|
||||
@@ -377,7 +300,7 @@
|
||||
<value><location> sections are allowed only within <configuration> sections.</value>
|
||||
</data>
|
||||
<data name="Config_location_path_invalid_character" xml:space="preserve">
|
||||
<value><location> path attribute must be a relative virtual path. It cannot contain any of '?' ':' '\\' '*' '"' '<' '>' or '|'.</value>
|
||||
<value><location> path attribute must be a relative virtual path. It cannot contain any of '?' ':' '\\' '*' '"' '<' '>' or '|'.</value>
|
||||
</data>
|
||||
<data name="Config_location_path_invalid_first_character" xml:space="preserve">
|
||||
<value><location> path attribute must be a relative virtual path. It cannot start with any of ' ' '.' '/' or '\\'.</value>
|
||||
@@ -412,9 +335,6 @@
|
||||
<data name="Config_properties_may_not_be_derived_from_configuration_section" xml:space="preserve">
|
||||
<value>The Configuration property '{0}' may not be derived from ConfigurationSection.</value>
|
||||
</data>
|
||||
<data name="Config_protection_section_not_found" xml:space="preserve">
|
||||
<value>Protection Section not found.</value>
|
||||
</data>
|
||||
<data name="Config_provider_must_implement_type" xml:space="preserve">
|
||||
<value>Provider must implement the class '{0}'.</value>
|
||||
</data>
|
||||
@@ -430,9 +350,6 @@
|
||||
<data name="Config_section_cannot_be_used_in_location" xml:space="preserve">
|
||||
<value>This section is not allowed in <location> elements. This section has been marked allowLocation="false".</value>
|
||||
</data>
|
||||
<data name="Config_section_group_missing_public_constructor" xml:space="preserve">
|
||||
<value>SectionGroup type does not have a public instance constructor that takes no arguments.</value>
|
||||
</data>
|
||||
<data name="Config_section_locked" xml:space="preserve">
|
||||
<value>This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.</value>
|
||||
</data>
|
||||
@@ -523,21 +440,12 @@
|
||||
<data name="Encryption_failed" xml:space="preserve">
|
||||
<value>Failed to encrypt the section '{0}' using provider '{1}'. Error message from the provider: {2}</value>
|
||||
</data>
|
||||
<data name="Expect_bool_value_for_DoNotShowUI" xml:space="preserve">
|
||||
<value>You must specify a boolean value for doNotShowUI.</value>
|
||||
</data>
|
||||
<data name="Expect_bool_value_for_useMachineProtection" xml:space="preserve">
|
||||
<value>You must specify a boolean value for useMachineProtection.</value>
|
||||
</data>
|
||||
<data name="IndexOutOfRange" xml:space="preserve">
|
||||
<value>Index {0} is out of range.</value>
|
||||
</data>
|
||||
<data name="Invalid_enum_value" xml:space="preserve">
|
||||
<value>The enumeration value must be one of the following: {0}.</value>
|
||||
</data>
|
||||
<data name="Key_container_doesnt_exist_or_access_denied" xml:space="preserve">
|
||||
<value>The RSA key container could not be opened.</value>
|
||||
</data>
|
||||
<data name="Must_add_to_config_before_protecting_it" xml:space="preserve">
|
||||
<value>The configuration section must be added to a configuration hierarchy before you can protect it.</value>
|
||||
</data>
|
||||
@@ -586,12 +494,6 @@
|
||||
<data name="Unrecognized_initialization_value" xml:space="preserve">
|
||||
<value>The configuration setting '{0}' was not recognized.</value>
|
||||
</data>
|
||||
<data name="UseMachineContainer_must_be_bool" xml:space="preserve">
|
||||
<value>You must specify a boolean value for useMachineContainer.</value>
|
||||
</data>
|
||||
<data name="UseOAEP_must_be_bool" xml:space="preserve">
|
||||
<value>You must specify a boolean value for useOAEP.</value>
|
||||
</data>
|
||||
<data name="Validation_scalar_range_violation_not_different" xml:space="preserve">
|
||||
<value>The value must be different than {0}.</value>
|
||||
</data>
|
||||
@@ -646,24 +548,9 @@
|
||||
<data name="WrongType_of_Protected_provider" xml:space="preserve">
|
||||
<value>The type specified does not extend ProtectedConfigurationProvider class.</value>
|
||||
</data>
|
||||
<data name="Type_from_untrusted_assembly" xml:space="preserve">
|
||||
<value>Type '{0}' cannot be instantiated under a partially trusted security policy (AllowPartiallyTrustedCallersAttribute is not present on the target assembly).</value>
|
||||
</data>
|
||||
<data name="Config_element_locking_not_supported" xml:space="preserve">
|
||||
<value>Locking of elements or attributes within a configuration section is not supported for legacy section '{0}'.</value>
|
||||
</data>
|
||||
<data name="Config_element_null_instance" xml:space="preserve">
|
||||
<value>The property '{0}' must not return null from the property's get method. Typically the getter should return base["{1}"].</value>
|
||||
</data>
|
||||
<data name="ConfigurationPermissionBadXml" xml:space="preserve">
|
||||
<value>Bad Xml {0}</value>
|
||||
</data>
|
||||
<data name="ConfigurationPermission_Denied" xml:space="preserve">
|
||||
<value>Request for ConfigurationPermission failed while attempting to access configuration section '{0}'. To allow all callers to access the data for this section, set section attribute 'requirePermission' equal 'false' in the configuration file where this section is declared.</value>
|
||||
</data>
|
||||
<data name="Section_from_untrusted_assembly" xml:space="preserve">
|
||||
<value>Configuration section '{0}' cannot be instantiated under a partially trusted security policy (AllowPartiallyTrustedCallersAttribute is not present on the configuration section handler).</value>
|
||||
</data>
|
||||
<data name="Protection_provider_syntax_error" xml:space="preserve">
|
||||
<value>A section using 'configProtectionProvider' may contain no other attributes.</value>
|
||||
</data>
|
||||
@@ -706,9 +593,6 @@
|
||||
<data name="Invalid_override_mode_declaration" xml:space="preserve">
|
||||
<value>A <location> tag may contain only one of the 'allowOverride' or 'overrideMode' attributes.</value>
|
||||
</data>
|
||||
<data name="Config_cannot_edit_locked_configurationsection_when_mode_is_not_allow" xml:space="preserve">
|
||||
<value>ConfigurationSection properties cannot be edited when locked but they can be unlocked by explicitly setting SectionInforamtion.OverrideMode to OverrideMode.Allow.</value>
|
||||
</data>
|
||||
<data name="Machine_config_file_not_found" xml:space="preserve">
|
||||
<value>The machine.config file '{0}' was not found.</value>
|
||||
</data>
|
||||
@@ -739,12 +623,6 @@
|
||||
<data name="UnknownUserLevel" xml:space="preserve">
|
||||
<value>Unknown ConfigurationUserLevel specified.</value>
|
||||
</data>
|
||||
<data name="PositionOutOfRange" xml:space="preserve">
|
||||
<value>Position cannot be less than zero.</value>
|
||||
</data>
|
||||
<data name="UnknownSeekOrigin" xml:space="preserve">
|
||||
<value>Unknown SeekOrigin specified.</value>
|
||||
</data>
|
||||
<data name="BothScopeAttributes" xml:space="preserve">
|
||||
<value>The setting {0} has both an ApplicationScopedSettingAttribute and a UserScopedSettingAttribute.</value>
|
||||
</data>
|
||||
@@ -769,9 +647,6 @@
|
||||
<data name="AppSettingsReaderNoKey" xml:space="preserve">
|
||||
<value>The key '{0}' does not exist in the appSettings configuration section.</value>
|
||||
</data>
|
||||
<data name="AppSettingsReaderNoParser" xml:space="preserve">
|
||||
<value>Type '{0}' does not have a Parse method.</value>
|
||||
</data>
|
||||
<data name="AppSettingsReaderCantParse" xml:space="preserve">
|
||||
<value>The value '{0}' was found in the appSettings configuration section for key '{1}', and this value is not a valid {2}.</value>
|
||||
</data>
|
||||
|
||||
@@ -1 +1 @@
|
||||
425d1c45fa760e8eb561fd44fae6a4b598e56365
|
||||
6784683f7c441d6399d46f429d9e9d9664700d87
|
||||
@@ -1737,7 +1737,7 @@ namespace System.Configuration
|
||||
// By default we try to load (i.e. parse/validate ) all properties
|
||||
// If a property value is invalid ( cannot be parsed or is not valid ) we will keep the value
|
||||
// as string ( from the xml ) and will write it out unchanged if needed
|
||||
// If the property value is needed by users the actuall exception will be thrown
|
||||
// If the property value is needed by users the actual exception will be thrown
|
||||
|
||||
string xmlValue = reader.Value;
|
||||
object propertyValue = null;
|
||||
@@ -1959,4 +1959,4 @@ namespace System.Configuration
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ namespace System.Configuration
|
||||
iFoundItem = index;
|
||||
if (entry.EntryType == EntryType.Added)
|
||||
{
|
||||
// this is a special case for defect number 529517 to emulate everett behavior
|
||||
// this is a special case for defect number 529517 to emulate Everett behavior
|
||||
localAddToEnd = true;
|
||||
}
|
||||
break;
|
||||
@@ -1297,4 +1297,4 @@ namespace System.Configuration
|
||||
object IDictionaryEnumerator.Value => _current.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -474,11 +474,11 @@ namespace System.Configuration
|
||||
|
||||
if (isUser && isApp)
|
||||
{
|
||||
throw new ConfigurationErrorsException(SR.BothScopeAttributes);
|
||||
throw new ConfigurationErrorsException(string.Format(SR.BothScopeAttributes, setting.Name));
|
||||
}
|
||||
else if (!(isUser || isApp))
|
||||
{
|
||||
throw new ConfigurationErrorsException(SR.NoScopeAttributes);
|
||||
throw new ConfigurationErrorsException(string.Format(SR.NoScopeAttributes, setting.Name));
|
||||
}
|
||||
|
||||
return isUser;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace System.Configuration
|
||||
// Default for section is ALLOW
|
||||
s_sectionDefault = new OverrideModeSetting { _mode = (byte)OverrideMode.Allow };
|
||||
|
||||
// Default for location tags is INHERIT. Note that we do not make the value as existant in the XML or specified by the API
|
||||
// Default for location tags is INHERIT. Note that we do not make the value as existent in the XML or specified by the API
|
||||
s_locationDefault = new OverrideModeSetting { _mode = (byte)OverrideMode.Inherit };
|
||||
}
|
||||
|
||||
@@ -350,4 +350,4 @@ namespace System.Configuration
|
||||
throw new ConfigurationErrorsException(SR.Cannot_change_both_AllowOverride_and_OverrideMode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace System.Configuration
|
||||
private object _serializedValue = null;
|
||||
private bool _changedSinceLastSerialized = false;
|
||||
|
||||
public string Name { get; private set; }
|
||||
public string Name => Property.Name;
|
||||
public bool IsDirty { get; set; }
|
||||
public SettingsProperty Property { get; private set; }
|
||||
public bool UsingDefaultValue { get; private set; }
|
||||
|
||||
@@ -374,10 +374,10 @@ namespace System.Configuration
|
||||
{
|
||||
Reader.Skip();
|
||||
|
||||
// We need to skip all the whitespaces following a skipped element.
|
||||
// - If the whitespaces don't contain /r/n, then it's okay to skip them
|
||||
// We need to skip all the whitespace following a skipped element.
|
||||
// - If the whitespace doesn't contain /r/n, then it's okay to skip them
|
||||
// as part of the element.
|
||||
// - If the whitespaces contain /r/n, not skipping them will result
|
||||
// - If the whitespace contains /r/n, not skipping them will result
|
||||
// in a redundant emtpy line being copied.
|
||||
if (Reader.NodeType == XmlNodeType.Whitespace) Reader.Skip();
|
||||
}
|
||||
@@ -468,7 +468,7 @@ namespace System.Configuration
|
||||
|
||||
int lineNumberOfEndElement = Reader.LineNumber;
|
||||
|
||||
// Read until we hit a a non-whitespace node or reach the end
|
||||
// Read until we hit a non-whitespace node or reach the end
|
||||
while (!Reader.EOF)
|
||||
{
|
||||
if (Reader.NodeType != XmlNodeType.Whitespace)
|
||||
@@ -1107,4 +1107,4 @@ namespace System.Configuration
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace MonoTests.System.Configuration
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NonExistantItem()
|
||||
public void NonExistentItem()
|
||||
{
|
||||
SysConfig cfg = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
|
||||
ConfigurationLockCollection col;
|
||||
|
||||
@@ -320,13 +320,13 @@ namespace MonoTests.System.Configuration
|
||||
[Fact]
|
||||
public void TestFileMap()
|
||||
{
|
||||
var name = Path.GetRandomFileName() + ".config";
|
||||
Assert.False(File.Exists(name));
|
||||
|
||||
try
|
||||
using (var temp = new TempDirectory())
|
||||
{
|
||||
string configPath = Path.Combine(temp.Path, Path.GetRandomFileName() + ".config");
|
||||
Assert.False(File.Exists(configPath));
|
||||
|
||||
var map = new ExeConfigurationFileMap();
|
||||
map.ExeConfigFilename = name;
|
||||
map.ExeConfigFilename = configPath;
|
||||
|
||||
var config = ConfigurationManager.OpenMappedExeConfiguration(
|
||||
map, ConfigurationUserLevel.None);
|
||||
@@ -335,12 +335,8 @@ namespace MonoTests.System.Configuration
|
||||
|
||||
config.Save();
|
||||
|
||||
Assert.True(File.Exists(name), "#1");
|
||||
Assert.True(File.Exists(Path.GetFullPath(name)), "#2");
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(name);
|
||||
Assert.True(File.Exists(configPath), "#1");
|
||||
Assert.True(File.Exists(Path.GetFullPath(configPath)), "#2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,13 +369,13 @@ namespace MonoTests.System.Configuration
|
||||
[Fact]
|
||||
public void TestContext2()
|
||||
{
|
||||
var name = Path.GetRandomFileName() + ".config";
|
||||
Assert.False(File.Exists(name));
|
||||
|
||||
try
|
||||
using (var temp = new TempDirectory())
|
||||
{
|
||||
string configPath = Path.Combine(temp.Path, Path.GetRandomFileName() + ".config");
|
||||
Assert.False(File.Exists(configPath));
|
||||
|
||||
var map = new ExeConfigurationFileMap();
|
||||
map.ExeConfigFilename = name;
|
||||
map.ExeConfigFilename = configPath;
|
||||
|
||||
var config = ConfigurationManager.OpenMappedExeConfiguration(
|
||||
map, ConfigurationUserLevel.None);
|
||||
@@ -389,11 +385,7 @@ namespace MonoTests.System.Configuration
|
||||
|
||||
config.Save();
|
||||
|
||||
Assert.True(File.Exists(name), "#1");
|
||||
}
|
||||
finally
|
||||
{
|
||||
File.Delete(name);
|
||||
Assert.True(File.Exists(configPath), "#1");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,20 +35,11 @@ namespace MonoTests.System.Configuration.Util
|
||||
|
||||
public static class TestUtil
|
||||
{
|
||||
|
||||
public static void RunWithTempFile(Action<string> action)
|
||||
{
|
||||
var filename = Path.GetTempFileName();
|
||||
|
||||
try
|
||||
using (var temp = new TempDirectory())
|
||||
{
|
||||
File.Delete(filename);
|
||||
action(filename);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(filename))
|
||||
File.Delete(filename);
|
||||
action(temp.GenerateRandomFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,21 +48,9 @@ namespace MonoTests.System.Configuration.Util
|
||||
|
||||
public static void RunWithTempFiles(MyAction<string, string> action)
|
||||
{
|
||||
var file1 = Path.GetTempFileName();
|
||||
var file2 = Path.GetTempFileName();
|
||||
|
||||
try
|
||||
using (var temp = new TempDirectory())
|
||||
{
|
||||
File.Delete(file1);
|
||||
File.Delete(file2);
|
||||
action(file1, file2);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(file1))
|
||||
File.Delete(file1);
|
||||
if (File.Exists(file2))
|
||||
File.Delete(file2);
|
||||
action(temp.GenerateRandomFilePath(), temp.GenerateRandomFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
<PropertyGroup>
|
||||
@@ -72,6 +72,7 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Strings.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="System\Configuration\ApplicationSettingsBaseTests.cs" />
|
||||
<Compile Include="System\Configuration\AppSettingsTests.cs" />
|
||||
<Compile Include="System\Configuration\ConfigPathUtilityTests.cs" />
|
||||
<Compile Include="System\Configuration\ConfigurationElementCollectionTests.cs" />
|
||||
@@ -80,15 +81,21 @@
|
||||
<Compile Include="System\Configuration\ConfigurationPropertyTests.cs" />
|
||||
<Compile Include="System\Configuration\ConfigurationTests.cs" />
|
||||
<Compile Include="System\Configuration\BasicCustomSectionTests.cs" />
|
||||
<Compile Include="System\Configuration\ConnectionStringsTests.cs" />
|
||||
<Compile Include="System\Configuration\ExceptionUtilTests.cs" />
|
||||
<Compile Include="System\Configuration\ImplicitMachineConfigTests.cs" />
|
||||
<Compile Include="System\Configuration\KeyValueConfigurationCollectionTests.cs" />
|
||||
<Compile Include="System\Configuration\LocalFileSettingsProviderTests.cs" />
|
||||
<Compile Include="System\Configuration\NameValueConfigurationCollectionTests.cs" />
|
||||
<Compile Include="System\Configuration\SectionGroupsTests.cs" />
|
||||
<Compile Include="System\Configuration\SmokeTest.cs" />
|
||||
<Compile Include="System\Configuration\StringUtilTests.cs" />
|
||||
<Compile Include="System\Configuration\TempConfig.cs" />
|
||||
<Compile Include="System\Configuration\TestData.cs" />
|
||||
<Compile Include="System\Configuration\TypeUtilTests.cs" />
|
||||
<Compile Include="System\Configuration\UriSectionTests.cs" />
|
||||
<Compile Include="System\Configuration\UrlPathTests.cs" />
|
||||
<Compile Include="System\Configuration\ValidatiorUtilsTests.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -0,0 +1,149 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using Xunit;
|
||||
|
||||
namespace System.ConfigurationTests
|
||||
{
|
||||
public class ApplicationSettingsBaseTests
|
||||
{
|
||||
private const int DefaultIntPropertyValue = 42;
|
||||
|
||||
private class SimpleSettings : ApplicationSettingsBase
|
||||
{
|
||||
[ApplicationScopedSetting]
|
||||
public string StringProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string) this[nameof(StringProperty)];
|
||||
}
|
||||
set
|
||||
{
|
||||
this[nameof(StringProperty)] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[UserScopedSetting]
|
||||
[DefaultSettingValue("42")]
|
||||
public int IntProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)this[nameof(IntProperty)];
|
||||
}
|
||||
set
|
||||
{
|
||||
this[nameof(IntProperty)] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Theory
|
||||
InlineData(true)
|
||||
InlineData(false)
|
||||
]
|
||||
public void Context_SimpleSettings_InNotNull(bool isSynchronized)
|
||||
{
|
||||
SimpleSettings settings = isSynchronized
|
||||
? (SimpleSettings)SettingsBase.Synchronized(new SimpleSettings())
|
||||
: new SimpleSettings();
|
||||
|
||||
Assert.NotNull(settings.Context);
|
||||
}
|
||||
|
||||
[Theory
|
||||
InlineData(true)
|
||||
InlineData(false)
|
||||
]
|
||||
public void Providers_SimpleSettings_Empty(bool isSynchronized)
|
||||
{
|
||||
SimpleSettings settings = isSynchronized
|
||||
? (SimpleSettings)SettingsBase.Synchronized(new SimpleSettings())
|
||||
: new SimpleSettings();
|
||||
|
||||
Assert.Equal(1, settings.Providers.Count);
|
||||
Assert.NotNull(settings.Providers[typeof(LocalFileSettingsProvider).Name]);
|
||||
}
|
||||
|
||||
[Theory
|
||||
InlineData(true)
|
||||
InlineData(false)
|
||||
]
|
||||
public void GetSetStringProperty_SimpleSettings_Ok(bool isSynchronized)
|
||||
{
|
||||
SimpleSettings settings = isSynchronized
|
||||
? (SimpleSettings)SettingsBase.Synchronized(new SimpleSettings())
|
||||
: new SimpleSettings();
|
||||
|
||||
Assert.Equal(default(string), settings.StringProperty);
|
||||
settings.StringProperty = "Foo";
|
||||
Assert.Equal("Foo", settings.StringProperty);
|
||||
}
|
||||
|
||||
[Theory
|
||||
InlineData(true)
|
||||
InlineData(false)
|
||||
]
|
||||
public void GetSetIntProperty_SimpleSettings_Ok(bool isSynchronized)
|
||||
{
|
||||
SimpleSettings settings = isSynchronized
|
||||
? (SimpleSettings)SettingsBase.Synchronized(new SimpleSettings())
|
||||
: new SimpleSettings();
|
||||
|
||||
Assert.Equal(DefaultIntPropertyValue, settings.IntProperty);
|
||||
settings.IntProperty = 10;
|
||||
Assert.Equal(10, settings.IntProperty);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Reload_SimpleSettings_Ok()
|
||||
{
|
||||
var settings = new SimpleSettings();
|
||||
settings.IntProperty = 10;
|
||||
|
||||
Assert.NotEqual(DefaultIntPropertyValue, settings.IntProperty);
|
||||
settings.Reload();
|
||||
Assert.Equal(DefaultIntPropertyValue, settings.IntProperty);
|
||||
}
|
||||
|
||||
[ReadOnly(false)]
|
||||
[SettingsGroupName("TestGroup")]
|
||||
[SettingsProvider(typeof(TestProvider))]
|
||||
[SettingsSerializeAs(SettingsSerializeAs.Binary)]
|
||||
private class SettingsWithAttributes : ApplicationSettingsBase
|
||||
{
|
||||
[ApplicationScopedSetting]
|
||||
[SettingsProvider(typeof(TestProvider))]
|
||||
public string StringProperty
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)this["StringProperty"];
|
||||
}
|
||||
set
|
||||
{
|
||||
this["StringProperty"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class TestProvider : LocalFileSettingsProvider
|
||||
{
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SettingsProperty_SettingsWithAttributes_Ok()
|
||||
{
|
||||
SettingsWithAttributes settings = new SettingsWithAttributes();
|
||||
|
||||
Assert.Equal(1, settings.Properties.Count);
|
||||
SettingsProperty property = settings.Properties["StringProperty"];
|
||||
Assert.Equal(typeof(TestProvider), property.Provider.GetType());
|
||||
Assert.Equal(SettingsSerializeAs.Binary, property.SerializeAs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Configuration;
|
||||
using Xunit;
|
||||
|
||||
namespace System.ConfigurationTests
|
||||
{
|
||||
public class ConnectionStringsTests
|
||||
{
|
||||
public static string SimpleConnectionStringConfiguration =
|
||||
@"<?xml version='1.0' encoding='utf-8' ?>
|
||||
<configuration>
|
||||
<connectionStrings>
|
||||
<add name='fooName' connectionString='fooConnectionString' providerName='fooProviderName' />
|
||||
</connectionStrings>
|
||||
</configuration>";
|
||||
|
||||
[Fact]
|
||||
public void SimpleConnectionString()
|
||||
{
|
||||
using (var temp = new TempConfig(SimpleConnectionStringConfiguration))
|
||||
{
|
||||
var config = ConfigurationManager.OpenExeConfiguration(temp.ExePath);
|
||||
Assert.NotNull(config.ConnectionStrings);
|
||||
Assert.NotNull(config.ConnectionStrings.ConnectionStrings);
|
||||
ConnectionStringSettings connection = config.ConnectionStrings.ConnectionStrings["fooName"];
|
||||
Assert.Equal("fooName", connection.Name);
|
||||
Assert.Equal("fooConnectionString", connection.ConnectionString);
|
||||
Assert.Equal("fooProviderName", connection.ProviderName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Configuration;
|
||||
using Xunit;
|
||||
|
||||
namespace System.ConfigurationTests
|
||||
{
|
||||
public class LocalFileSettingsProviderTests
|
||||
{
|
||||
private readonly SettingsContext _testContext = new SettingsContext
|
||||
{
|
||||
["GroupName"] = "GroupNameFoo",
|
||||
["SettingsKey"] = "SettingsKeyFoo"
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void GetPropertyValues_NotStoredProperty_ValueEqualsNull()
|
||||
{
|
||||
var property = new SettingsProperty("PropertyName");
|
||||
property.Attributes.Add(typeof(UserScopedSettingAttribute), new UserScopedSettingAttribute());
|
||||
var properties = new SettingsPropertyCollection();
|
||||
properties.Add(property);
|
||||
var localFileSettingsProvider = new LocalFileSettingsProvider();
|
||||
|
||||
SettingsPropertyValueCollection propertyValues = localFileSettingsProvider.GetPropertyValues(_testContext, properties);
|
||||
|
||||
Assert.Equal(1, propertyValues.Count);
|
||||
Assert.Equal(null, propertyValues["PropertyName"].PropertyValue);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetPropertyValues_NotStoredConnectionStringProperty_ValueEqualsEmptyString()
|
||||
{
|
||||
var property = new SettingsProperty("PropertyName");
|
||||
property.PropertyType = typeof (string);
|
||||
property.Attributes.Add(typeof(ApplicationScopedSettingAttribute), new ApplicationScopedSettingAttribute());
|
||||
property.Attributes.Add(typeof(SpecialSettingAttribute), new SpecialSettingAttribute(SpecialSetting.ConnectionString));
|
||||
var properties = new SettingsPropertyCollection();
|
||||
properties.Add(property);
|
||||
var localFileSettingsProvider = new LocalFileSettingsProvider();
|
||||
|
||||
SettingsPropertyValueCollection propertyValues = localFileSettingsProvider.GetPropertyValues(_testContext, properties);
|
||||
|
||||
Assert.Equal(1, propertyValues.Count);
|
||||
Assert.Equal(string.Empty, propertyValues["PropertyName"].PropertyValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Configuration;
|
||||
using Xunit;
|
||||
|
||||
namespace System.ConfigurationTests
|
||||
{
|
||||
public class NameValueConfigurationCollectionTests
|
||||
{
|
||||
[Fact]
|
||||
public void CollectionType_EqualsAddRemoveClearMap()
|
||||
{
|
||||
Assert.Equal(ConfigurationElementCollectionType.AddRemoveClearMap, new NameValueConfigurationCollection().CollectionType);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AllKeys_EmptyCollection()
|
||||
{
|
||||
Assert.Empty(new NameValueConfigurationCollection().AllKeys);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Add_NullKeyValue_Throws()
|
||||
{
|
||||
var element = new NameValueConfigurationElement(null, null);
|
||||
Assert.Throws<ConfigurationErrorsException>(() => new NameValueConfigurationCollection().Add(element));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Add_NullValue_Ok()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
var element = new NameValueConfigurationElement("foo", null);
|
||||
collection.Add(element);
|
||||
Assert.Null(collection["foo"].Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetElement_NoElementWithGivenName_Ok()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
collection["foo"] = new NameValueConfigurationElement("foo", "bar");
|
||||
Assert.Equal("bar", collection["foo"].Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetElement_ElementWithGivenNameExists_Ok()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
collection["foo"] = new NameValueConfigurationElement("foo", "bar");
|
||||
Assert.Equal("bar", collection["foo"].Value);
|
||||
collection["foo"] = new NameValueConfigurationElement("foo", "barModified");
|
||||
Assert.Equal("barModified", collection["foo"].Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SetElement_IndexAndElementNameMismatch_ElementNameIsUsed()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
collection["foo"] = new NameValueConfigurationElement("fooMismatched", "bar");
|
||||
Assert.Equal("bar", collection["fooMismatched"].Value);
|
||||
Assert.Null(collection["foo"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Add_ElementWithExistingName_Throws()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
var element1 = new NameValueConfigurationElement("foo", "foo");
|
||||
var element2 = new NameValueConfigurationElement("foo", "bar");
|
||||
collection.Add(element1);
|
||||
Assert.Throws<ConfigurationErrorsException>(() => collection.Add(element2));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Value_AssignNewValue_Ok()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
var element = new NameValueConfigurationElement("foo", "foo");
|
||||
collection.Add(element);
|
||||
collection["foo"].Value = "bar";
|
||||
Assert.Equal("bar", collection["foo"].Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Remove_ByName_ElementIsNull()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
var element = new NameValueConfigurationElement("foo", "foo");
|
||||
collection.Add(element);
|
||||
Assert.Equal("foo", collection["foo"].Value);
|
||||
collection.Remove("foo");
|
||||
Assert.Null(collection["foo"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Remove_ByElement_ElementIsNull()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
var element = new NameValueConfigurationElement("foo", "foo");
|
||||
collection.Add(element);
|
||||
Assert.Equal("foo", collection["foo"].Value);
|
||||
collection.Remove(element);
|
||||
Assert.Null(collection["foo"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Clear_NotEmptyCollection_EmptyCollection()
|
||||
{
|
||||
var collection = new NameValueConfigurationCollection();
|
||||
var element = new NameValueConfigurationElement("foo", "foo");
|
||||
collection.Add(element);
|
||||
Assert.NotEmpty(collection);
|
||||
collection.Clear();
|
||||
Assert.Empty(collection);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user