Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes the IConvertible warning thrown on Windows Phone reported on #317 #376

Merged
merged 1 commit into from
Feb 3, 2015
Merged
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
1 change: 1 addition & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
4 changes: 2 additions & 2 deletions src/Humanizer.Tests/DateHumanizeDefaultStrategyTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change? Oh, let me guess cause it's February?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the review. Yes, you're right. Suddenly the unit tests started failing!! Do'h!

[InlineData(32, "one month ago")]
public void DaysAgo(int days, string expected)
{
Expand All @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer.Tests/DehumanizeToEnumTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Humanizer/EnumDehumanizeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class EnumDehumanizeExtensions
/// <exception cref="NoMatchFoundException">Couldn't find any enum member that matches the string</exception>
/// <returns></returns>
public static TTargetEnum DehumanizeTo<TTargetEnum>(this string input)
where TTargetEnum : struct, IComparable, IFormattable, IConvertible
where TTargetEnum : struct, IComparable, IFormattable
{
return (TTargetEnum)DehumanizeToPrivate(input, typeof(TTargetEnum), OnNoMatch.ThrowsException);
}
Expand Down