From 57fbbc3b652d51e65bf94725d3bdb98f1a6d78b2 Mon Sep 17 00:00:00 2001 From: Michael Yarichuk Date: Wed, 7 May 2025 16:31:29 +0300 Subject: [PATCH] chore: minor refactor for JenkinsJobRunner to make it run with client mock (so it uses interface and not concrete class) --- Jenkins.Net/Utilities/JenkinsJobRunner.cs | 4 ++-- Jenkins.Net/Utilities/ProgressiveTextReader.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Jenkins.Net/Utilities/JenkinsJobRunner.cs b/Jenkins.Net/Utilities/JenkinsJobRunner.cs index 2110c61..2b6881a 100644 --- a/Jenkins.Net/Utilities/JenkinsJobRunner.cs +++ b/Jenkins.Net/Utilities/JenkinsJobRunner.cs @@ -28,7 +28,7 @@ namespace JenkinsNET.Utilities /// public class JenkinsJobRunner { - public JenkinsClient Client {get;} + public IJenkinsClient Client {get;} protected ProgressiveTextReader textReader; protected bool isJobStarted; @@ -91,7 +91,7 @@ public class JenkinsJobRunner /// /// Creates a new JobRunner using the provided Jenkins-Client. /// - public JenkinsJobRunner(JenkinsClient client) + public JenkinsJobRunner(IJenkinsClient client) { this.Client = client ?? throw new ArgumentNullException(nameof(client)); } diff --git a/Jenkins.Net/Utilities/ProgressiveTextReader.cs b/Jenkins.Net/Utilities/ProgressiveTextReader.cs index a29e69e..54553e6 100644 --- a/Jenkins.Net/Utilities/ProgressiveTextReader.cs +++ b/Jenkins.Net/Utilities/ProgressiveTextReader.cs @@ -18,7 +18,7 @@ namespace JenkinsNET.Utilities /// public class ProgressiveTextReader { - private readonly JenkinsClient client; + private readonly IJenkinsClient client; private readonly string jobName; private readonly string buildNumber; private int readPos; @@ -46,7 +46,7 @@ public class ProgressiveTextReader /// The Jenkins client to use for network operations. /// The name of the Jenkins Job. /// The build-number of the running Jenkins Job. - public ProgressiveTextReader(JenkinsClient client, string jobName, string buildNumber) + public ProgressiveTextReader(IJenkinsClient client, string jobName, string buildNumber) { this.client = client ?? throw new ArgumentNullException(nameof(client)); this.jobName = jobName ?? throw new ArgumentNullException(nameof(jobName));