mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
Add tests to verify current observable behavior
Right now, our observable methods are semi-cold. They don't make the request until subscribed, but multiple subscriptions get the same result. This is the way that Octokit.cocoa works.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit.Reactive.Clients;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Integration
|
||||
{
|
||||
public class ObservableRepositoriesClientTests
|
||||
{
|
||||
public class TheGetMethod
|
||||
{
|
||||
[IntegrationTest]
|
||||
public async Task ReturnsSpecifiedRepository()
|
||||
{
|
||||
var github = new GitHubClient("Octokit Test Runner")
|
||||
{
|
||||
Credentials = Helper.Credentials
|
||||
};
|
||||
var client = new ObservableRepositoriesClient(github);
|
||||
var observable = client.Get("haacked", "seegit");
|
||||
var repository = await observable;
|
||||
var repository2 = await observable;
|
||||
|
||||
Assert.Equal("https://github.com/Haacked/SeeGit.git", repository.CloneUrl);
|
||||
Assert.False(repository.Private);
|
||||
Assert.False(repository.Fork);
|
||||
Assert.Equal("https://github.com/Haacked/SeeGit.git", repository2.CloneUrl);
|
||||
Assert.False(repository2.Private);
|
||||
Assert.False(repository2.Fork);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user