You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@@ -2,7 +2,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>
|
||||
<AssemblyVersion>4.1.1.0</AssemblyVersion>
|
||||
<AssemblyKey>MSFT</AssemblyKey>
|
||||
<IsNETCoreApp>true</IsNETCoreApp>
|
||||
<IsUAP>true</IsUAP>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -105,7 +105,6 @@ namespace System.Resources
|
||||
public SatelliteContractVersionAttribute(string version) { }
|
||||
public string Version { get { throw null; } }
|
||||
}
|
||||
[System.Serializable]
|
||||
public enum UltimateResourceFallbackLocation
|
||||
{
|
||||
MainAssembly,
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
|
||||
<ProjectGuid>{3E7810B2-2802-4867-B223-30427F3F2D5B}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<!-- Help VS understand available configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// 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
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,13 +43,5 @@ namespace System.Resources.Tests
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Xunit;
|
||||
using System.Reflection;
|
||||
using System.Globalization;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace System.Resources.Tests
|
||||
{
|
||||
@@ -38,5 +39,107 @@ namespace System.Resources.Tests
|
||||
string actual = resourceManager.GetString(key);
|
||||
Assert.Equal(expectedValue, actual);
|
||||
}
|
||||
|
||||
[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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
// 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,12 +18,13 @@
|
||||
<DependentUpon>TestResx.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SatelliteContractVersionAttributeTests.cs" />
|
||||
<Compile Include="$(CommonTestPath)\System\PlatformDetection.cs">
|
||||
<Link>CommonTest\System\PlatformDetection.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="$(CommonTestPath)/System/Runtime/Serialization/Formatters/BinaryFormatterHelpers.cs">
|
||||
<Link>System/Runtime/Serialization/Formatters/BinaryFormatterHelpers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MissingManifestResourceExceptionTests.netstandard.cs" />
|
||||
<Compile Include="MissingSatelliteAssemblyException.cs" />
|
||||
<Compile Include="ResourceManagerTests.netstandard.cs" />
|
||||
<Compile Include="ResourceSetTests.cs" />
|
||||
<EmbeddedResource Include="Resources\TestResx.netstandard17.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
@@ -42,4 +43,4 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user