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:
Haacked
2013-10-17 09:49:48 -07:00
parent abde37c576
commit 3f5e561111
3 changed files with 67 additions and 0 deletions
@@ -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);
}
}
}
}