mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 12:03:19 +00:00
Added get release by tag endpoint (#1793)
* Added get release by tag endpoint * Added integration tests for get release by tag overload * tidy up integration tests and add reactive integration tests * Implement repositoryId based method * Implement repositoryId based method in Reactive client
This commit is contained in:
@@ -84,5 +84,49 @@ namespace Octokit.Tests.Integration.Reactive
|
||||
Assert.NotEqual(firstPage[4].Id, secondPage[4].Id);
|
||||
}
|
||||
}
|
||||
|
||||
public class TheGetMethod
|
||||
{
|
||||
readonly ObservableReleasesClient _releaseClient;
|
||||
|
||||
public TheGetMethod()
|
||||
{
|
||||
var github = Helper.GetAuthenticatedClient();
|
||||
|
||||
_releaseClient = new ObservableReleasesClient(github);
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsReleaseByTag()
|
||||
{
|
||||
var releaseByTag = await _releaseClient.Get("octokit", "octokit.net", "v0.28.0");
|
||||
|
||||
Assert.Equal(releaseByTag.Id, 8396883);
|
||||
Assert.Equal(releaseByTag.Name, "v0.28 - Get to the Chopper!!!");
|
||||
Assert.Equal(releaseByTag.TagName, "v0.28.0");
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsReleaseWithRepositoryIdByTag()
|
||||
{
|
||||
var releaseByTag = await _releaseClient.Get(7528679, "v0.28.0");
|
||||
|
||||
Assert.Equal(releaseByTag.Id, 8396883);
|
||||
Assert.Equal(releaseByTag.Name, "v0.28 - Get to the Chopper!!!");
|
||||
Assert.Equal(releaseByTag.TagName, "v0.28.0");
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ThrowsWhenTagNotFound()
|
||||
{
|
||||
await Assert.ThrowsAsync<NotFoundException>(async () => await _releaseClient.Get("octokit", "octokit.net", "0.0"));
|
||||
}
|
||||
|
||||
[IntegrationTest]
|
||||
public async Task ThrowsWhenTagNotFoundWithRepositoryId()
|
||||
{
|
||||
await Assert.ThrowsAsync<NotFoundException>(async () => await _releaseClient.Get(7528679, "0.0"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user