mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 12:03:19 +00:00
fix unit test now that each stats type calls a different Get<> method
This commit is contained in:
@@ -18,7 +18,65 @@ namespace Octokit.Tests.Clients
|
||||
{
|
||||
client.GetStatistics(type);
|
||||
|
||||
connection.Received().Get<AdminStats>(Arg.Is<Uri>(u => u == "enterprise/stats/{0}".FormatUri(type.ToString().ToLowerInvariant())), null);
|
||||
string expectedUri = String.Format("enterprise/stats/{0}", type.ToString().ToLowerInvariant());
|
||||
switch (type)
|
||||
{
|
||||
case AdminStatsType.All:
|
||||
{
|
||||
connection.Received().Get<AdminStats>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Repos:
|
||||
{
|
||||
connection.Received().Get<AdminStatsRepos>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Hooks:
|
||||
{
|
||||
connection.Received().Get<AdminStatsHooks>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Pages:
|
||||
{
|
||||
connection.Received().Get<AdminStatsPages>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Orgs:
|
||||
{
|
||||
connection.Received().Get<AdminStatsOrgs>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Users:
|
||||
{
|
||||
connection.Received().Get<AdminStatsUsers>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Pulls:
|
||||
{
|
||||
connection.Received().Get<AdminStatsPulls>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Issues:
|
||||
{
|
||||
connection.Received().Get<AdminStatsIssues>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Milestones:
|
||||
{
|
||||
connection.Received().Get<AdminStatsMilestones>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Gists:
|
||||
{
|
||||
connection.Received().Get<AdminStatsGists>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
case AdminStatsType.Comments:
|
||||
{
|
||||
connection.Received().Get<AdminStatsComments>(Arg.Is<Uri>(u => u.ToString() == expectedUri), null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user