-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SonarQube fixes for release 6.2.0 (#151)
* sonar qube fixed and adding UT --------- Co-authored-by: Aditya Narayan <[email protected]>
- Loading branch information
1 parent
a6d7da1
commit b5ca02d
Showing
6 changed files
with
63 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/LCT.APICommunications.UTest/DebianJfrogAPICommunicationUTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
// SPDX-FileCopyrightText: 2024 Siemens AG | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// -------------------------------------------------------------------------------------------------------------------- | ||
|
||
|
||
using LCT.APICommunications.Model; | ||
|
||
namespace LCT.APICommunications.UTest | ||
{ | ||
public class DebainJfrogAPICommunicationUTest | ||
{ | ||
[SetUp] | ||
public void Setup() | ||
{ | ||
// Method intentionally left empty. | ||
} | ||
|
||
[Test] | ||
public void DebainJfrogApiCommunication_CopyFromRemoteRepo_ReturnsInvalidOperationException() | ||
{ | ||
//Arrange | ||
ArtifactoryCredentials repoCredentials = new ArtifactoryCredentials(); | ||
|
||
//Act | ||
JfrogApicommunication jfrogApicommunication = new DebianJfrogAPICommunication("", "", repoCredentials,100); | ||
|
||
//Assert | ||
Assert.ThrowsAsync<InvalidOperationException>(async () => await jfrogApicommunication.CopyFromRemoteRepo(new ComponentsToArtifactory())); | ||
} | ||
|
||
[Test] | ||
public void DebainJfrogApiCommunication_UpdatePackagePropertiesInJfrog_ReturnsInvalidOperationException() | ||
{ | ||
//Arrange | ||
ArtifactoryCredentials repoCredentials = new ArtifactoryCredentials(); | ||
|
||
//Act | ||
JfrogApicommunication jfrogApicommunication = new DebianJfrogAPICommunication("", "", repoCredentials, 100); | ||
|
||
//Assert | ||
Assert.ThrowsAsync<InvalidOperationException>(() => { jfrogApicommunication.UpdatePackagePropertiesInJfrog("", "", new UploadArgs()); return Task.CompletedTask; }); | ||
} | ||
|
||
[Test] | ||
public void DebainJfrogApiCommunication_GetPackageInfo_ReturnsInvalidOperationException() | ||
{ | ||
//Arrange | ||
ArtifactoryCredentials repoCredentials = new ArtifactoryCredentials(); | ||
|
||
//Act | ||
JfrogApicommunication jfrogApicommunication = new DebianJfrogAPICommunication("", "", repoCredentials, 100); | ||
|
||
//Assert | ||
Assert.ThrowsAsync<InvalidOperationException>(async () => await jfrogApicommunication.GetPackageInfo(new ComponentsToArtifactory())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters