| | | 1 | | using System.Threading.Tasks; |
| | | 2 | | using ApplicationCore.Model; |
| | | 3 | | using Microsoft.Extensions.Logging; |
| | | 4 | | |
| | | 5 | | namespace ApplicationCore |
| | | 6 | | { |
| | | 7 | | /// <summary> |
| | | 8 | | /// Service that only logs the request to create a new pull request without actually creating a pull request |
| | | 9 | | /// </summary> |
| | | 10 | | public class NoOpPullRequestService : IPullRequestService |
| | | 11 | | { |
| | | 12 | | private readonly ILogger _log; |
| | | 13 | | |
| | 2 | 14 | | public NoOpPullRequestService(ILoggerProvider loggerProvider) |
| | 2 | 15 | | { |
| | 2 | 16 | | if (loggerProvider is null) |
| | 1 | 17 | | { |
| | 1 | 18 | | throw new System.ArgumentNullException(nameof(loggerProvider)); |
| | | 19 | | } |
| | | 20 | | |
| | 1 | 21 | | _log = loggerProvider.CreateLogger(nameof(NoOpPullRequestService)); |
| | 1 | 22 | | } |
| | | 23 | | |
| | | 24 | | public Task<PullRequestResult> TryCreatePullRequestAsync(Comment comment) |
| | 1 | 25 | | { |
| | 1 | 26 | | _log.LogInformation(CommentResources.NoOpPullRequestSkipped); |
| | | 27 | | |
| | 1 | 28 | | return Task.FromResult(new PullRequestResult()); |
| | 1 | 29 | | } |
| | | 30 | | } |
| | | 31 | | } |