mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-19 13:45:12 +00:00
complete test method with stub class used for serialization
This commit is contained in:
@@ -128,7 +128,6 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class TheTestMethod
|
||||
{
|
||||
[Fact]
|
||||
@@ -139,7 +138,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
client.Hooks.Test("fake", "repo", 12345678);
|
||||
|
||||
connection.Received().Post<RepositoryHook>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/hooks/12345678/tests"), null);
|
||||
connection.Received().Post<TestRepositoryHook>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/hooks/12345678/tests"), Arg.Any<TestRepositoryHook>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -159,7 +158,7 @@ namespace Octokit.Tests.Clients
|
||||
|
||||
client.Hooks.Test("owner", "repo", 12345678);
|
||||
|
||||
connection.Received().Post<RepositoryHook>(Arg.Any<Uri>(), Arg.Is<object>(o => o == null));
|
||||
connection.Received().Post<TestRepositoryHook>(Arg.Any<Uri>(), Arg.Any<TestRepositoryHook>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,12 +80,10 @@ namespace Octokit
|
||||
/// <returns></returns>
|
||||
public Task Test(string owner, string repositoryName, int hookId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
|
||||
|
||||
//Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
//Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
|
||||
|
||||
//return ApiConnection.Post<object>(ApiUrls.RepositoryHookTest(owner, repositoryName, hookId), null);
|
||||
return ApiConnection.Post<TestRepositoryHook>(ApiUrls.RepositoryHookTest(owner, repositoryName, hookId), new TestRepositoryHook());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
12
Octokit/Models/Request/TestRepositoryHook.cs
Normal file
12
Octokit/Models/Request/TestRepositoryHook.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
public class TestRepositoryHook
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -69,6 +69,7 @@
|
||||
<Compile Include="Models\Request\NewMilestone.cs" />
|
||||
<Compile Include="Models\Request\NewRepositoryHook.cs" />
|
||||
<Compile Include="Models\Request\RequestParameters.cs" />
|
||||
<Compile Include="Models\Request\TestRepositoryHook.cs" />
|
||||
<Compile Include="Models\Response\CommitStatus.cs" />
|
||||
<Compile Include="Models\Response\Issue.cs" />
|
||||
<Compile Include="Models\Request\IssueRequest.cs" />
|
||||
|
||||
Reference in New Issue
Block a user