Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -0,0 +1,93 @@
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.Resources.ResourceManager.Tests", "tests\System.Resources.ResourceManager.Tests.csproj", "{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}"
ProjectSection(ProjectDependencies) = postProject
{01F82B23-B433-4926-9E58-F87A25287EE9} = {01F82B23-B433-4926-9E58-F87A25287EE9}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Resources.ResourceManager", "src\System.Resources.ResourceManager.csproj", "{01F82B23-B433-4926-9E58-F87A25287EE9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9F3DE59A-0027-42D7-A8BB-0EB480587564}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{9D6DC1B1-5C9D-49F6-83EC-9CD434677E96}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Resources.ResourceManager", "ref\System.Resources.ResourceManager.csproj", "{E5D665D5-443B-45DC-8C36-74932FAB3848}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{C677611B-73CA-4C6D-B7AA-32CE96B4EA25}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU
DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = uap101aot-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = uap101aot-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = uap101aot-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = uap101aot-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = uap101aot-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = uap101aot-Windows_NT-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = uap101aot-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppuap101aot-Windows_NTnetcoreapp|AnyCPU.Build.0 = uap101aot-Windows_NT-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{01F82B23-B433-4926-9E58-F87A25287EE9}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1} = {1D51A16C-B6D8-4E8F-98DE-21AD9A7062A1}
{01F82B23-B433-4926-9E58-F87A25287EE9} = {01F82B23-B433-4926-9E58-F87A25287EE9}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
uap;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,114 @@
// 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.
// ------------------------------------------------------------------------------
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Resources
{
public interface IResourceReader : System.Collections.IEnumerable, System.IDisposable
{
void Close();
new System.Collections.IDictionaryEnumerator GetEnumerator();
}
public sealed partial class ResourceReader : IResourceReader
{
public ResourceReader(System.IO.Stream stream) { }
public ResourceReader(string fileName) { }
public void Close() { }
public void Dispose() { }
public void GetResourceData(string resourceName, out string resourceType, out byte[] resourceData) { throw null; }
public System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public partial class MissingManifestResourceException : System.SystemException
{
public MissingManifestResourceException() { }
public MissingManifestResourceException(string message) { }
public MissingManifestResourceException(string message, System.Exception inner) { }
protected MissingManifestResourceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.Serializable]
public class MissingSatelliteAssemblyException : System.SystemException
{
public MissingSatelliteAssemblyException(): base() { }
public MissingSatelliteAssemblyException(String message): base() { }
public MissingSatelliteAssemblyException(String message, String cultureName): base() { }
public MissingSatelliteAssemblyException(String message, Exception inner): base() { }
protected MissingSatelliteAssemblyException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context): base() { }
public String CultureName { get { throw null; } }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(1), AllowMultiple = false)]
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public sealed class NeutralResourcesLanguageAttribute : System.Attribute
{
public NeutralResourcesLanguageAttribute(string cultureName) { }
public string CultureName { get { throw null; } }
public NeutralResourcesLanguageAttribute(string cultureName, UltimateResourceFallbackLocation location) { }
public UltimateResourceFallbackLocation Location { get { throw null; } }
}
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public class ResourceManager
{
public static readonly int HeaderVersionNumber;
public static readonly int MagicNumber;
protected System.Reflection.Assembly MainAssembly;
protected ResourceManager() { }
public ResourceManager(string baseName, System.Reflection.Assembly assembly) { }
public ResourceManager(string baseName, System.Reflection.Assembly assembly, System.Type usingResourceSet) { }
public ResourceManager(System.Type resourceSource) { }
public virtual string BaseName { get { throw null; } }
public virtual bool IgnoreCase { get { throw null; } set { } }
public virtual System.Type ResourceSetType { get { throw null; } }
protected static System.Globalization.CultureInfo GetNeutralResourcesLanguage(System.Reflection.Assembly a) { throw null; }
public virtual object GetObject(string name) { throw null; }
public virtual object GetObject(string name, System.Globalization.CultureInfo culture) { throw null; }
protected virtual string GetResourceFileName(System.Globalization.CultureInfo culture) { throw null; }
public virtual ResourceSet GetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) { throw null; }
protected static System.Version GetSatelliteContractVersion(System.Reflection.Assembly a) { throw null; }
public System.IO.UnmanagedMemoryStream GetStream(string name) { throw null; }
public System.IO.UnmanagedMemoryStream GetStream(string name, System.Globalization.CultureInfo culture) { throw null; }
public virtual string GetString(string name) { throw null; }
public virtual string GetString(string name, System.Globalization.CultureInfo culture) { throw null; }
protected virtual ResourceSet InternalGetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) { throw null; }
public virtual void ReleaseAllResources() { }
protected UltimateResourceFallbackLocation FallbackLocation { get { throw null; } set { } }
public static ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, System.Type usingResourceSet) { throw null; }
}
[System.Serializable]
public class ResourceSet : System.IDisposable, System.Collections.IEnumerable
{
protected ResourceSet() { }
public ResourceSet(System.IO.Stream stream) { }
public ResourceSet(string fileName) { }
public ResourceSet(IResourceReader reader) { }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual Type GetDefaultReader() { throw null; }
public virtual Type GetDefaultWriter() { throw null; }
public virtual System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public virtual object GetObject(string name) { throw null; }
public virtual object GetObject(string name, bool ignoreCase) { throw null; }
public virtual string GetString(string name) { throw null; }
public virtual string GetString(string name, bool ignoreCase) { throw null; }
protected virtual void ReadResources() { }
}
[System.AttributeUsageAttribute((System.AttributeTargets)(1), AllowMultiple = false)]
[System.ComponentModel.EditorBrowsableAttribute((System.ComponentModel.EditorBrowsableState)(1))]
public sealed class SatelliteContractVersionAttribute : System.Attribute
{
public SatelliteContractVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
[System.Serializable]
public enum UltimateResourceFallbackLocation
{
MainAssembly,
Satellite
}
}

View File

@@ -0,0 +1,18 @@
<?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" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System.Resources.ResourceManager.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.InteropServices\ref\System.Runtime.InteropServices.csproj" />
<ProjectReference Include="..\..\System.Reflection\ref\System.Reflection.csproj" />
<ProjectReference Include="..\..\System.Globalization\ref\System.Globalization.csproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,35 @@
Compat issues with assembly System.Resources.ResourceManager:
TypesMustExist : Type 'System.Resources.IResourceReader' does not exist in the implementation but it does exist in the contract.
CannotRemoveBaseTypeOrInterface : Type 'System.Resources.MissingManifestResourceException' does not inherit from base type 'System.SystemException' in the implementation but it does in the contract.
MembersMustExist : Member 'System.Resources.MissingManifestResourceException..ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Resources.MissingSatelliteAssemblyException' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.NeutralResourcesLanguageAttribute..ctor(System.String, System.Resources.UltimateResourceFallbackLocation)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.NeutralResourcesLanguageAttribute.Location.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Int32 System.Resources.ResourceManager.HeaderVersionNumber' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Int32 System.Resources.ResourceManager.MagicNumber' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Reflection.Assembly System.Resources.ResourceManager.MainAssembly' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.String System.Resources.ResourceManager.BaseNameField' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager..ctor()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager..ctor(System.String, System.Reflection.Assembly, System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.BaseName.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.CreateFileBasedResourceManager(System.String, System.String, System.Type)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.FallbackLocation.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.FallbackLocation.set(System.Resources.UltimateResourceFallbackLocation)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetNeutralResourcesLanguage(System.Reflection.Assembly)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetObject(System.String)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetResourceFileName(System.Globalization.CultureInfo)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetResourceSet(System.Globalization.CultureInfo, System.Boolean, System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetSatelliteContractVersion(System.Reflection.Assembly)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetStream(System.String)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.GetStream(System.String, System.Globalization.CultureInfo)' does not exist in the implementation but it does exist in the contract.
CannotMakeMemberNonVirtual : Member 'System.Resources.ResourceManager.GetString(System.String)' is non-virtual in the implementation but is virtual in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.IgnoreCase.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.IgnoreCase.set(System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, System.Boolean, System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.ReleaseAllResources()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Resources.ResourceManager.ResourceSetType.get()' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Resources.ResourceReader' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Resources.ResourceSet' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Resources.UltimateResourceFallbackLocation' does not exist in the implementation but it does exist in the contract.
Total Issues: 33

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
net463-Windows_NT;
uap101aot-Windows_NT;
netcoreapp;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,126 @@
<?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">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Arg_MissingManifestResourceException" xml:space="preserve">
<value>Unable to find manifest resource.</value>
</data>
<data name="MissingManifestResource_ResWFileNotLoaded" xml:space="preserve">
<value>Unable to load resources for resource file '{0}'.</value>
</data>
</root>

View File

@@ -0,0 +1,43 @@
<?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" />
<PropertyGroup>
<AssemblyName>System.Resources.ResourceManager</AssemblyName>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' != 'uap101aot'">true</IsPartialFacadeAssembly>
<ResourcesSourceOutputDirectory Condition="'$(TargetGroup)' != 'uap101aot'">None</ResourcesSourceOutputDirectory>
<SkipCommonResourcesIncludes Condition="'$(TargetGroup)'=='uap101aot'">true</SkipCommonResourcesIncludes>
<AllowUnsafeBlocks Condition="'$(TargetGroup)' == 'uap101aot'">true</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap101aot-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='uap101aot-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)' == 'uap101aot'">
<Compile Include="System\Resources\MissingManifestResourceException.cs" />
<Compile Include="System\Resources\NeutralResourcesLanguageAttribute.cs" />
<Compile Include="System\Resources\ResourceManager.cs" />
<Compile Include="System\Resources\SatelliteContractVersionAttribute.cs" />
<Compile Include="$(CommonPath)\System\HResults.cs">
<Link>Common\System\HResults.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\SR.Core.cs">
<Link>Common\System\SR.Core.cs</Link>
</Compile>
<TargetingPackReference Include="System.Private.CoreLib.WinRTInterop" />
<ProjectReference Include="$(SourceDir)/mscorlib.WinRT-Facade/mscorlib.WinRT-Facade.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<TargetingPackReference Include="System.Private.CoreLib" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'net463'">
<TargetingPackReference Include="mscorlib" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Diagnostics.Tools" />
<ReferenceFromRuntime Include="System.Private.CoreLib" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,34 @@
// 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.Runtime.Serialization;
namespace System.Resources
{
[Serializable]
public class MissingManifestResourceException : SystemException
{
public MissingManifestResourceException()
: base(SR.Arg_MissingManifestResourceException)
{
HResult = HResults.COR_E_MISSINGMANIFESTRESOURCE;
}
public MissingManifestResourceException(string message)
: base(message)
{
HResult = HResults.COR_E_MISSINGMANIFESTRESOURCE;
}
public MissingManifestResourceException(string message, Exception inner)
: base(message, inner)
{
HResult = HResults.COR_E_MISSINGMANIFESTRESOURCE;
}
protected MissingManifestResourceException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
}
}

View File

@@ -0,0 +1,27 @@
// 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.
namespace System.Resources
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class NeutralResourcesLanguageAttribute : Attribute
{
private readonly string _culture;
public NeutralResourcesLanguageAttribute(string cultureName)
{
if (cultureName == null)
{
throw new ArgumentNullException(nameof(cultureName));
}
_culture = cultureName;
}
public string CultureName
{
get { return _culture; }
}
}
}

View File

@@ -0,0 +1,136 @@
// 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.Globalization;
using System.Reflection;
using Internal.Runtime.Augments;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Resources.Core;
namespace System.Resources
{
public class ResourceManager
{
private readonly object _resourceMap;
private readonly string _resourcesSubtree;
private readonly string _neutralResourcesCultureName;
protected Assembly MainAssembly;
public ResourceManager(Type resourceSource)
{
if (null == resourceSource)
{
throw new ArgumentNullException(nameof(resourceSource));
}
// Portable libraries resources are indexed under the type full name
_resourcesSubtree = resourceSource.FullName;
_resourceMap = GetResourceMap(_resourcesSubtree);
}
public ResourceManager(string baseName, Assembly assembly)
{
if (null == baseName)
{
throw new ArgumentNullException(nameof(baseName));
}
if (null == assembly)
{
throw new ArgumentNullException(nameof(assembly));
}
MainAssembly = assembly;
_resourcesSubtree = baseName;
_resourceMap = GetResourceMap(_resourcesSubtree);
_neutralResourcesCultureName = GetNeutralLanguageForAssembly(assembly);
}
public ResourceManager(string resourcesName)
{
_resourcesSubtree = resourcesName;
_resourceMap = GetResourceMap(_resourcesSubtree);
}
public string GetString(string name)
{
return GetString(name, null);
}
protected static CultureInfo GetNeutralResourcesLanguage(Assembly a)
{
string lang = GetNeutralLanguageForAssembly(a);
return lang == null ? CultureInfo.InvariantCulture : new CultureInfo(lang);
}
// Looks up a resource value for a particular name. Looks in the
// specified CultureInfo, and if not found, all parent CultureInfos.
// Returns null if the resource wasn't found.
//
public virtual string GetString(string name, CultureInfo culture)
{
if (null == name)
{
throw new ArgumentNullException(nameof(name));
}
if (WinRTInterop.Callbacks.IsAppxModel() && _resourceMap == null)
{
if (name.Equals("MissingManifestResource_ResWFileNotLoaded") &&
_resourcesSubtree.Equals("FxResources.System.Resources.ResourceManager.SR", StringComparison.OrdinalIgnoreCase))
{
// If we get here, means we are missing the resources even for the message MissingManifestResource_ResWFileNotLoaded
// it is important to throw the exception using the hardcoded message to prevent the stack overflow from occurring.
throw new MissingManifestResourceException("Unable to load resources for resource file " + _resourcesSubtree + ".");
}
throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_ResWFileNotLoaded, _resourcesSubtree));
}
return GetResourceString(name, culture == null ? null : culture.Name);
}
private static string GetNeutralLanguageForAssembly(Assembly assembly)
{
foreach (CustomAttributeData cad in assembly.CustomAttributes)
{
if (cad.AttributeType.FullName.Equals("System.Resources.NeutralResourcesLanguageAttribute"))
{
foreach (CustomAttributeTypedArgument cata in cad.ConstructorArguments)
{
if (cata.ArgumentType.Equals(typeof(System.String)))
{
return (string) cata.Value;
}
}
}
}
// The assembly is not tagged with NeutralResourcesLanguageAttribute
return null;
}
//
// WinRT Wrappers
//
private object GetResourceMap(string subtreeName)
{
if (WinRTInterop.Callbacks.IsAppxModel())
return WinRTInterop.Callbacks.GetResourceMap(subtreeName) ;
return null;
}
private string GetResourceString(string resourceName, string languageName)
{
if (!WinRTInterop.Callbacks.IsAppxModel())
{
// on desktop we usually don't have resource strings. so we just return the key name
return resourceName;
}
return WinRTInterop.Callbacks.GetResourceString(_resourceMap, resourceName, languageName, _neutralResourcesCultureName);
}
}
}

View File

@@ -0,0 +1,27 @@
// 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.
namespace System.Resources
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public sealed class SatelliteContractVersionAttribute : Attribute
{
private readonly string _version;
public SatelliteContractVersionAttribute(string version)
{
if (version == null)
{
throw new ArgumentNullException(nameof(version));
}
_version = version;
}
public string Version
{
get { return _version; }
}
}
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netstandard1.3;
netstandard;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,36 @@
// 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 Xunit;
namespace System.Resources.Tests
{
public partial class MissingManifestResourceExceptionTests
{
[Fact]
public static void ConstructorSimple()
{
MissingManifestResourceException mmre = new MissingManifestResourceException();
Assert.NotNull(mmre.Message);
}
[Fact]
public static void ConstructorWithMessage()
{
string message = "message";
MissingManifestResourceException mmre = new MissingManifestResourceException(message);
Assert.Equal(message, mmre.Message);
}
[Fact]
public static void ConstructorWithMessageAndInnerException()
{
string message = "message";
Exception innerException = new Exception();
MissingManifestResourceException mmre = new MissingManifestResourceException(message, innerException);
Assert.Equal(message, mmre.Message);
Assert.Same(innerException, mmre.InnerException);
}
}
}

View File

@@ -0,0 +1,20 @@
// 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.Runtime.Serialization.Formatters.Tests;
using Xunit;
namespace System.Resources.Tests
{
public partial class MissingManifestResourceExceptionTests
{
[Fact]
public void Serialization()
{
const string message = "FATAL ERROR: The pizza could not be found.";
var ex = new MissingManifestResourceException(message);
BinaryFormatterHelpers.AssertRoundtrips(ex);
}
}
}

View File

@@ -0,0 +1,55 @@
// 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.Runtime.Serialization.Formatters.Tests;
using Xunit;
namespace System.Resources.Tests
{
public partial class MissingSatelliteAssemblyExceptionTests
{
[Fact]
public void ConstructorSimple()
{
MissingSatelliteAssemblyException msae = new MissingSatelliteAssemblyException();
Assert.NotNull(msae.Message);
}
[Fact]
public void ConstructorWithMessage()
{
const string message = "message";
MissingSatelliteAssemblyException msae = new MissingSatelliteAssemblyException(message);
Assert.Equal(message, msae.Message);
}
[Fact]
public void ConstructorWithMessageAndCultureName()
{
const string message = "message";
const string cultureName = "fr-FR";
MissingSatelliteAssemblyException msae = new MissingSatelliteAssemblyException(message, cultureName);
Assert.Equal(message, msae.Message);
Assert.Equal(cultureName, msae.CultureName);
}
[Fact]
public void ConstructorWithMessageAndInnerException()
{
string message = "message";
Exception innerException = new Exception();
MissingSatelliteAssemblyException msae = new MissingSatelliteAssemblyException(message, innerException);
Assert.Equal(message, msae.Message);
Assert.Same(innerException, msae.InnerException);
}
[Fact]
public void Serialization()
{
const string cultureName = "fr-FR";
MissingSatelliteAssemblyException msae = new MissingSatelliteAssemblyException("message", cultureName);
BinaryFormatterHelpers.AssertRoundtrips(msae);
}
}
}

View File

@@ -0,0 +1,28 @@
// 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 Xunit;
namespace System.Resources.Tests
{
public static class NeutralResourcesLanguageAttributeTests
{
[Theory]
[InlineData("en-us")]
[InlineData("de-DE")]
[InlineData("fr-FR")]
[InlineData("")]
public static void ConstructorBasic(string cultureName)
{
NeutralResourcesLanguageAttribute nrla = new NeutralResourcesLanguageAttribute(cultureName);
Assert.Equal(cultureName, nrla.CultureName);
}
[Fact]
public static void ConstructorArgumentNull()
{
Assert.Throws<ArgumentNullException>(() => new NeutralResourcesLanguageAttribute(null));
}
}
}

View File

@@ -0,0 +1,42 @@
// 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 Xunit;
using System.Reflection;
using System.Globalization;
using System.Collections.Generic;
namespace System.Resources.Tests
{
public static partial class ResourceManagerTests
{
public static IEnumerable<object[]> EnglishResourceData()
{
yield return new object[] { "One", "Value-One" };
yield return new object[] { "Two", "Value-Two" };
yield return new object[] { "Three", "Value-Three" };
yield return new object[] { "Empty", "" };
yield return new object[] { "InvalidKeyName", null };
}
[Theory]
[MemberData(nameof(EnglishResourceData))]
public static void GetString_Basic(string key, string expectedValue)
{
ResourceManager resourceManager = new ResourceManager("System.Resources.Tests.Resources.TestResx", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
string actual = resourceManager.GetString(key);
Assert.Equal(expectedValue, actual);
}
[Theory]
[MemberData(nameof(EnglishResourceData))]
public static void GetString_FromResourceType(string key, string expectedValue)
{
Type resourceType = typeof(Resources.TestResx);
ResourceManager resourceManager = new ResourceManager(resourceType);
string actual = resourceManager.GetString(key);
Assert.Equal(expectedValue, actual);
}
}
}

View File

@@ -0,0 +1,118 @@
// 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;
using System.IO;
using System.Reflection;
using System.Globalization;
using System.Collections.Generic;
using Xunit;
namespace System.Resources.Tests
{
public static partial class ResourceManagerTests
{
[Fact]
public static void HeaderVersionNumber()
{
Assert.Equal(1, ResourceManager.HeaderVersionNumber);
}
[Fact]
public static void MagicNumber()
{
Assert.Equal(unchecked((int)0xBEEFCACE), ResourceManager.MagicNumber);
}
[Fact]
public static void UsingResourceSet()
{
var resourceManager = new ResourceManager("System.Resources.Tests.Resources.TestResx", typeof(ResourceManagerTests).GetTypeInfo().Assembly, typeof(ResourceSet));
Assert.Equal(typeof(ResourceSet), resourceManager.ResourceSetType);
}
[Fact]
public static void BaseName()
{
var manager = new ResourceManager("System.Resources.Tests.Resources.TestResx", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
Assert.Equal("System.Resources.Tests.Resources.TestResx", manager.BaseName);
}
[Theory]
[MemberData(nameof(EnglishResourceData))]
public static void IgnoreCase(string key, string expectedValue)
{
var manager = new ResourceManager("System.Resources.Tests.Resources.TestResx", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
var culture = new CultureInfo("en-US");
Assert.False(manager.IgnoreCase);
Assert.Equal(expectedValue, manager.GetString(key, culture));
Assert.Null(manager.GetString(key.ToLower(), culture));
manager.IgnoreCase = true;
Assert.Equal(expectedValue, manager.GetString(key, culture));
Assert.Equal(expectedValue, manager.GetString(key.ToLower(), culture));
}
public static IEnumerable<object[]> EnglishNonStringResourceData()
{
yield return new object[] { "Int", 42 };
yield return new object[] { "Float", 3.14159 };
yield return new object[] { "Bytes", new byte[] { 41, 42, 43, 44, 192, 168, 1, 1 } };
yield return new object[] { "InvalidKeyName", null };
}
[Theory]
[MemberData(nameof(EnglishNonStringResourceData))]
[ActiveIssue(12565, TestPlatforms.AnyUnix)]
public static void GetObject(string key, object expectedValue)
{
var manager = new ResourceManager("System.Resources.Tests.Resources.TestResx.netstandard17", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
Assert.Equal(expectedValue, manager.GetObject(key));
Assert.Equal(expectedValue, manager.GetObject(key, new CultureInfo("en-US")));
}
[Theory]
[MemberData(nameof(EnglishResourceData))]
public static void GetResourceSet_Strings(string key, string expectedValue)
{
var manager = new ResourceManager("System.Resources.Tests.Resources.TestResx", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
var culture = new CultureInfo("en-US");
ResourceSet set = manager.GetResourceSet(culture, true, true);
Assert.Equal(expectedValue, set.GetString(key));
}
[Theory]
[MemberData(nameof(EnglishNonStringResourceData))]
[ActiveIssue(12565, TestPlatforms.AnyUnix)]
public static void GetResourceSet_NonStrings(string key, object expectedValue)
{
var manager = new ResourceManager("System.Resources.Tests.Resources.TestResx.netstandard17", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
var culture = new CultureInfo("en-US");
ResourceSet set = manager.GetResourceSet(culture, true, true);
Assert.Equal(expectedValue, set.GetObject(key));
}
[Fact]
[ActiveIssue(12565, TestPlatforms.AnyUnix)]
public static void GetStream()
{
var manager = new ResourceManager("System.Resources.Tests.Resources.TestResx.netstandard17", typeof(ResourceManagerTests).GetTypeInfo().Assembly);
var culture = new CultureInfo("en-US");
var expectedBytes = new byte[] { 41, 42, 43, 44, 192, 168, 1, 1 };
using (Stream stream = manager.GetStream("ByteStream"))
{
foreach (byte b in expectedBytes)
{
Assert.Equal(b, stream.ReadByte());
}
}
using (Stream stream = manager.GetStream("ByteStream", culture))
{
foreach (byte b in expectedBytes)
{
Assert.Equal(b, stream.ReadByte());
}
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More