Skip to content

Instantly share code, notes, and snippets.

@runceel
Created June 2, 2019 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save runceel/980cd28b716eaa550dc408307e0e22a0 to your computer and use it in GitHub Desktop.
Save runceel/980cd28b716eaa550dc408307e0e22a0 to your computer and use it in GitHub Desktop.
using Moq;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp10
{
class Program
{
static void Main(string[] args)
{
var mock = new Mock<IHoge>(MockBehavior.Strict);
mock.Setup(x => x.GetThreadsAsync("id", 53, It.IsAny<int?>(), It.IsAny<int?>(), It.IsAny<object>(), It.IsAny<CancellationToken>())).ReturnsAsync(new List<GitPullRequestCommentThread>()).Verifiable();
var r = mock.Object.GetThreadsAsync("id", 53);
mock.Verify();
}
}
public interface IHoge
{
Task<List<GitPullRequestCommentThread>> GetThreadsAsync(Guid project, string repositoryId, int pullRequestId, int? iteration = null, int? baseIteration = null, object userState = null, CancellationToken cancellationToken = default);
Task<List<GitPullRequestCommentThread>> GetThreadsAsync(Guid project, Guid repositoryId, int pullRequestId, int? iteration = null, int? baseIteration = null, object userState = null, CancellationToken cancellationToken = default);
Task<List<GitPullRequestCommentThread>> GetThreadsAsync(string repositoryId, int pullRequestId, int? iteration = null, int? baseIteration = null, object userState = null, CancellationToken cancellationToken = default);
Task<List<GitPullRequestCommentThread>> GetThreadsAsync(string project, string repositoryId, int pullRequestId, int? iteration = null, int? baseIteration = null, object userState = null, CancellationToken cancellationToken = default);
Task<List<GitPullRequestCommentThread>> GetThreadsAsync(Guid repositoryId, int pullRequestId, int? iteration = null, int? baseIteration = null, object userState = null, CancellationToken cancellationToken = default);
Task<List<GitPullRequestCommentThread>> GetThreadsAsync(string project, Guid repositoryId, int pullRequestId, int? iteration = null, int? baseIteration = null, object userState = null, CancellationToken cancellationToken = default);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment