-
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.
- Loading branch information
Sumanth K B
committed
Jul 7, 2023
1 parent
9bb24b7
commit c42471f
Showing
2 changed files
with
22 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,12 +143,13 @@ public async Task TestReleaseCreation_ClearingStateAsNewClearing() | |
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | ||
httpClient.DefaultRequestHeaders.Authorization = | ||
new AuthenticationHeaderValue(TestConstant.TestSw360TokenType, TestConstant.TestSw360TokenValue); | ||
string expectedname = "zone.js"; | ||
string expectedversion = "0.10.3"; | ||
string expecteddownloadurl = "https://github.com/angular/angular.git"; | ||
string expectedexternalid = "pkg:npm/[email protected]"; | ||
string expectedname = "typescript"; | ||
string expectedversion = "3.6.5"; | ||
string expecteddownloadurl = "https://github.com/Microsoft/TypeScript.git"; | ||
string expectedexternalid = "pkg:npm/[email protected]"; | ||
string expectedclearingState = "NEW_CLEARING"; | ||
//url formation for retrieving component details | ||
string url = TestConstant.Sw360ReleaseApi + TestConstant.componentNameUrl + "zone.js"; | ||
string url = TestConstant.Sw360ReleaseApi + TestConstant.componentNameUrl + "typescript"; | ||
string responseBody = await httpClient.GetStringAsync(url);//GET method | ||
var responseData = JsonConvert.DeserializeObject<ReleaseIdOfComponent>(responseBody); | ||
string urlofreleaseid = responseData.Embedded.Sw360Releases[0].Links.Self.Href; | ||
|
@@ -166,6 +167,7 @@ public async Task TestReleaseCreation_ClearingStateAsNewClearing() | |
Assert.AreEqual(expectedversion, version, "Test Project Version"); | ||
Assert.AreEqual(expecteddownloadurl, downloadurl, "Test download Url of rxjs"); | ||
Assert.AreEqual(expectedexternalid, externalid, "Test component external id"); | ||
Assert.AreEqual(expectedclearingState, clearingState); | ||
} | ||
|
||
|
||
|
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 |
---|---|---|
|
@@ -146,29 +146,31 @@ public async Task TestReleaseCreation_ClearingStateAsNewClearing() | |
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | ||
httpClient.DefaultRequestHeaders.Authorization = | ||
new AuthenticationHeaderValue(TestConstant.TestSw360TokenType, TestConstant.TestSw360TokenValue); | ||
string expectedname = "zone.js"; | ||
string expectedversion = "0.10.3"; | ||
string expecteddownloadurl = "https://github.com/angular/angular.git"; | ||
string expectedexternalid = "pkg:npm/[email protected]"; | ||
//string expectedname = "zone.js"; | ||
//string expectedversion = "0.10.3"; | ||
//string expecteddownloadurl = "https://github.com/angular/angular.git"; | ||
//string expectedexternalid = "pkg:npm/[email protected]"; | ||
string expectedclearingState = "NEW_CLEARING"; | ||
//url formation for retrieving component details | ||
string url = TestConstant.Sw360ReleaseApi + TestConstant.componentNameUrl + "zone.js"; | ||
string url = TestConstant.Sw360ReleaseApi + TestConstant.componentNameUrl + "rxjs"; | ||
string responseBody = await httpClient.GetStringAsync(url);//GET method | ||
var responseData = JsonConvert.DeserializeObject<ReleaseIdOfComponent>(responseBody); | ||
string urlofreleaseid = responseData.Embedded.Sw360Releases[0].Links.Self.Href; | ||
string responseForRelease = await httpClient.GetStringAsync(urlofreleaseid);//GET method for fetching the release details | ||
var responseDataForRelease = JsonConvert.DeserializeObject<Releases>(responseForRelease); | ||
|
||
string name = responseDataForRelease.Name; | ||
string version = responseDataForRelease.Version; | ||
string downloadurl = responseDataForRelease.SourceDownloadurl; | ||
//string name = responseDataForRelease.Name; | ||
//string version = responseDataForRelease.Version; | ||
//string downloadurl = responseDataForRelease.SourceDownloadurl; | ||
//string externalid = responseDataForRelease.ExternalIds.Package_Url; | ||
string clearingState = responseDataForRelease.ClearingState; | ||
string externalid = responseDataForRelease.ExternalIds.Package_Url; | ||
|
||
//Assert | ||
Assert.AreEqual(expectedname, name, "Test Project Name"); | ||
Assert.AreEqual(expectedversion, version, "Test Project Version"); | ||
Assert.AreEqual(expecteddownloadurl, downloadurl, "Test download Url of axios"); | ||
Assert.AreEqual(expectedexternalid, externalid, "Test component external id"); | ||
//Assert.AreEqual(expectedname, name, "Test Project Name"); | ||
//Assert.AreEqual(expectedversion, version, "Test Project Version"); | ||
//Assert.AreEqual(expecteddownloadurl, downloadurl, "Test download Url of axios"); | ||
//Assert.AreEqual(expectedexternalid, externalid, "Test component external id"); | ||
Assert.AreEqual(expectedclearingState, clearingState); | ||
} | ||
|
||
[TearDown] | ||
|