mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using System;
|
|
using NSubstitute;
|
|
using Octokit.Reactive;
|
|
using Xunit;
|
|
|
|
namespace Octokit.Tests.Reactive
|
|
{
|
|
public class ObservableGitIgnoreClientTests
|
|
{
|
|
public class TheGetAllGitIgnoreTemplatesMethod
|
|
{
|
|
[Fact]
|
|
public void CallsIntoClient()
|
|
{
|
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
|
var client = new ObservableGitIgnoreClient(gitHubClient);
|
|
|
|
client.GetAllGitIgnoreTemplates();
|
|
|
|
gitHubClient.GitIgnore.Received(1).GetAllGitIgnoreTemplates();
|
|
}
|
|
}
|
|
|
|
public class TheGetGitIgnoreTemplate
|
|
{
|
|
[Fact]
|
|
public void CallsIntoClient()
|
|
{
|
|
var gitHubClient = Substitute.For<IGitHubClient>();
|
|
var client = new ObservableGitIgnoreClient(gitHubClient);
|
|
|
|
client.GetGitIgnoreTemplate("template");
|
|
|
|
gitHubClient.GitIgnore.Received(1).GetGitIgnoreTemplate("template");
|
|
}
|
|
}
|
|
|
|
public class TheCtor
|
|
{
|
|
[Fact]
|
|
public void EnsuresNonNullArguments()
|
|
{
|
|
Assert.Throws<ArgumentNullException>(() => new ObservableGitIgnoreClient((IGitHubClient)null));
|
|
}
|
|
}
|
|
}
|
|
}
|