allow deserialization of IReadOnlyCollection<T>

This commit is contained in:
lbargaoanu
2014-01-17 16:48:31 +02:00
parent 364db535cd
commit 7af19ab319
2 changed files with 6 additions and 5 deletions
@@ -102,6 +102,7 @@ public class UsersClientTests
public class TheGetEmailsMethod
{
[IntegrationTest]
public async Task RetrievesEmailsForUser()
{
var github = new GitHubClient(new ProductHeaderValue("OctokitTests"))
@@ -111,10 +112,10 @@ public class UsersClientTests
var emails = await github.User.GetEmails();
Assert.Equal(1, emails.Count());
Assert.Equal("test-octowin@example.com", emails.First().Email);
Assert.True(emails.First().Primary);
Assert.False(emails.First().Verified);
Assert.NotEmpty(emails);
var email = emails.First();
Assert.True(email.Primary);
Assert.False(email.Verified);
}
}
}
+1 -1
View File
@@ -1638,7 +1638,7 @@ namespace Octokit
Type genericDefinition = type.GetGenericTypeDefinition();
return (genericDefinition == typeof(IList<>) || genericDefinition == typeof(ICollection<>) || genericDefinition == typeof(IEnumerable<>));
return genericDefinition == typeof(IList<>) || genericDefinition == typeof(ICollection<>) || genericDefinition == typeof(IEnumerable<>) || genericDefinition == typeof(IReadOnlyCollection<>);
}
public static bool IsAssignableFrom(Type type1, Type type2)