From f8075834b3f17affee30cc4a81fb97bfc6376493 Mon Sep 17 00:00:00 2001 From: MehdiK Date: Mon, 2 Feb 2015 17:53:16 +1000 Subject: [PATCH] Fixes the IConvertible warning thrown on Windows Phone reported on #317 --- release_notes.md | 1 + src/Humanizer.Tests/DateHumanizeDefaultStrategyTests.cs | 4 ++-- src/Humanizer.Tests/DehumanizeToEnumTests.cs | 2 +- src/Humanizer/EnumDehumanizeExtensions.cs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/release_notes.md b/release_notes.md index 293ec8449..3a4a5870f 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,4 +1,5 @@ ###In Development + - [#376](https://github.com/MehdiK/Humanizer/pull/376): Fixes the IConvertible warning thrown on Windows Phone reported on #317 [Commits](https://github.com/MehdiK/Humanizer/compare/v1.33.0...master) diff --git a/src/Humanizer.Tests/DateHumanizeDefaultStrategyTests.cs b/src/Humanizer.Tests/DateHumanizeDefaultStrategyTests.cs index b9853ce28..a7152894e 100644 --- a/src/Humanizer.Tests/DateHumanizeDefaultStrategyTests.cs +++ b/src/Humanizer.Tests/DateHumanizeDefaultStrategyTests.cs @@ -94,7 +94,7 @@ public void HoursFromNowNotTomorrow(int hours, string expected) [Theory] [InlineData(1, "yesterday")] [InlineData(10, "10 days ago")] - [InlineData(28, "28 days ago")] + [InlineData(27, "27 days ago")] [InlineData(32, "one month ago")] public void DaysAgo(int days, string expected) { @@ -104,7 +104,7 @@ public void DaysAgo(int days, string expected) [Theory] [InlineData(1, "tomorrow")] [InlineData(10, "10 days from now")] - [InlineData(28, "28 days from now")] + [InlineData(27, "27 days from now")] [InlineData(32, "one month from now")] public void DaysFromNow(int days, string expected) { diff --git a/src/Humanizer.Tests/DehumanizeToEnumTests.cs b/src/Humanizer.Tests/DehumanizeToEnumTests.cs index c6d1326cf..34cc6e87c 100644 --- a/src/Humanizer.Tests/DehumanizeToEnumTests.cs +++ b/src/Humanizer.Tests/DehumanizeToEnumTests.cs @@ -86,7 +86,7 @@ public void HonorsLocalizedDisplayAttribute() Assert.Equal(EnumUnderTest.MemberWithLocalizedDisplayAttribute, EnumTestsResources.MemberWithLocalizedDisplayAttribute.DehumanizeTo(typeof(EnumUnderTest))); } - struct DummyStructWithEnumInterfaces : IComparable, IFormattable, IConvertible + struct DummyStructWithEnumInterfaces : IComparable, IFormattable { public int CompareTo(object obj) { diff --git a/src/Humanizer/EnumDehumanizeExtensions.cs b/src/Humanizer/EnumDehumanizeExtensions.cs index c6f1a86b2..157b30141 100644 --- a/src/Humanizer/EnumDehumanizeExtensions.cs +++ b/src/Humanizer/EnumDehumanizeExtensions.cs @@ -17,7 +17,7 @@ public static class EnumDehumanizeExtensions /// Couldn't find any enum member that matches the string /// public static TTargetEnum DehumanizeTo(this string input) - where TTargetEnum : struct, IComparable, IFormattable, IConvertible + where TTargetEnum : struct, IComparable, IFormattable { return (TTargetEnum)DehumanizeToPrivate(input, typeof(TTargetEnum), OnNoMatch.ThrowsException); }