public async Task JobsClient_ArtifactsDestroy_HappyPath() { var connection = new Mock <IConnection>(); connection.Setup(c => c.Post(ApiUrls.JobsArtifactsDestroy("j123abc"), null, null)) .Returns(() => { return(Task.CompletedTask); }); var logsConnection = new Mock <IConnection>(); var jobsClient = new JobsClient(connection.Object, logsConnection.Object); await jobsClient.ArtifactsDestroy("j123abc"); connection.Verify( c => c.Post(ApiUrls.JobsArtifactsDestroy("j123abc"), null, null), Times.Exactly(1) ); }
public async Task JobsClient_ArtifactsDestroy_With_Parameters() { var connection = new Mock <IConnection>(); connection.Setup(c => c.Post(ApiUrls.JobsArtifactsDestroy("j123abc"), It.IsAny <IDictionary <string, string> >(), null)) .Returns(() => { return(Task.CompletedTask); }); var logsConnection = new Mock <IConnection>(); var jobsClient = new JobsClient(connection.Object, logsConnection.Object); await jobsClient.ArtifactsDestroy("j123abc", new DestroyArtifactsParameters() { Files = "myfiles*" }); connection.Verify( c => c.Post(ApiUrls.JobsArtifactsDestroy("j123abc"), It.IsAny <IDictionary <string, string> >(), null), Times.Exactly(1) ); }