Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/System.Runtime.Extensions/System.Runtime.Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ Global
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.Debug|Any CPU.ActiveCfg = Windows_Debug|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Debug|Any CPU.ActiveCfg = net462_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Debug|Any CPU.Build.0 = net462_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Release|Any CPU.ActiveCfg = net462_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Release|Any CPU.Build.0 = net462_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Debug|Any CPU.ActiveCfg = net463_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Debug|Any CPU.Build.0 = net463_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Release|Any CPU.ActiveCfg = net463_Debug|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Release|Any CPU.Build.0 = net463_Debug|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Debug|Any CPU.ActiveCfg = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Debug|Any CPU.Build.0 = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Release|Any CPU.ActiveCfg = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.net46_Release|Any CPU.Build.0 = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Debug|Any CPU.ActiveCfg = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Debug|Any CPU.Build.0 = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Release|Any CPU.ActiveCfg = net461_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.netstandard1.7_Release|Any CPU.Build.0 = net461_Release|Any CPU
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the changes in this file necessary?

Copy link
Copy Markdown
Author

@AlexRadch AlexRadch Dec 20, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think No. I will remove this. My VS created this.

{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.Release|Any CPU.ActiveCfg = Windows_Release|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.Unix_Debug|Any CPU.ActiveCfg = Unix_Debug|Any CPU
{845D2B72-D8A4-42E5-9BE9-17639EC4FC1A}.Unix_Debug|Any CPU.Build.0 = Unix_Debug|Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,9 @@ protected StringComparer() { }
public static System.StringComparer InvariantCultureIgnoreCase { get { throw null; } }
public static System.StringComparer Ordinal { get { throw null; } }
public static System.StringComparer OrdinalIgnoreCase { get { throw null; } }
#if netcoreapp11
public static System.StringComparer FromComparison(System.StringComparison comparisonType) { throw null; }
#endif
public abstract int Compare(string x, string y);
public static System.StringComparer Create(System.Globalization.CultureInfo culture, bool ignoreCase) { throw null; }
public new bool Equals(object x, object y) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<Compile Include="System\IO\Path.GetRelativePath.cs" />
<Compile Include="System\MathTests.netcoreapp1.1.cs" />
<Compile Include="System\MathF.netcoreapp1.1.cs" />
<Compile Include="System\StringComparer.netcoreapp1.1.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="System\Diagnostics\Stopwatch.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -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 System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Xunit;

namespace System.Tests
{
public static partial class MiscStringComparerTests
{
public static readonly object[][] FromComparison_TestData =
{
// StringComparison StringComparer
new object[] { StringComparison.CurrentCulture, StringComparer.CurrentCulture },
new object[] { StringComparison.CurrentCultureIgnoreCase, StringComparer.CurrentCultureIgnoreCase },
new object[] { StringComparison.InvariantCulture, StringComparer.InvariantCulture },
new object[] { StringComparison.InvariantCultureIgnoreCase, StringComparer.InvariantCultureIgnoreCase },
new object[] { StringComparison.Ordinal, StringComparer.Ordinal },
new object[] { StringComparison.OrdinalIgnoreCase, StringComparer.OrdinalIgnoreCase },
};

[Theory]
[MemberData(nameof(FromComparison_TestData))]
public static void FromComparisonTest(StringComparison comparison, StringComparer comparer)
{
Assert.Equal(comparer, StringComparer.FromComparison(comparison));
}

[Fact]
public static void FromComparisonInvalidTest()
{
StringComparison minInvalid = Enum.GetValues(typeof(StringComparison)).Cast<StringComparison>().Min() - 1;
StringComparison maxInvalid = Enum.GetValues(typeof(StringComparison)).Cast<StringComparison>().Max() + 1;

Assert.Throws<ArgumentException>(() => StringComparer.FromComparison(minInvalid));
Assert.Throws<ArgumentException>(() => StringComparer.FromComparison(maxInvalid));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Tests
{
public static class MiscStringComparerTests
public static partial class MiscStringComparerTests
{
public static IEnumerable<object[]> UpperLowerCasing_TestData()
{
Expand Down