-
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.
Merge pull request #247 from siemens/RefactorCode_-PackageUploadHelpe…
…rCsFile Refactored the PackageUploadHelper class on Artifactory Uploader
- Loading branch information
Showing
18 changed files
with
2,085 additions
and
1,881 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
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,47 @@ | ||
using LCT.APICommunications.Model; | ||
using LCT.ArtifactoryUploader.Model; | ||
using LCT.ArtifactoryUploader; | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using LCT.APICommunications.Model.AQL; | ||
using LCT.Services.Interface; | ||
using Moq; | ||
|
||
namespace AritfactoryUploader.UTest | ||
{ | ||
public class JfrogRepoUpdaterTest | ||
{ | ||
[Test] | ||
public async Task GetJfrogRepoInfoForAllTypePackages_GivenDestRepoNames_ReturnsAqlResultList() | ||
{ | ||
// Arrange | ||
var destRepoNames = new List<string> { "repo1", "repo2", "repo3" }; | ||
var expectedAqlResultList = new List<AqlResult> | ||
{ | ||
new AqlResult { Name = "result1" }, | ||
new AqlResult { Name = "result2" }, | ||
new AqlResult { Name = "result3" } | ||
}; | ||
|
||
var jFrogServiceMock = new Mock<IJFrogService>(); | ||
jFrogServiceMock.Setup(service => service.GetInternalComponentDataByRepo(It.IsAny<string>())) | ||
.ReturnsAsync(expectedAqlResultList); | ||
JfrogRepoUpdater.jFrogService = jFrogServiceMock.Object; | ||
|
||
// Act | ||
var actualAqlResultList = await JfrogRepoUpdater.GetJfrogRepoInfoForAllTypePackages(destRepoNames); | ||
|
||
|
||
// Assert | ||
Assert.That(actualAqlResultList.Count, Is.GreaterThan(2)); | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.