mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-06 07:16:09 +00:00
New convention test was added. Now each "TheCtor" class must have "EnsuresNonNullArguments" method were throwing of ArgumentNullException from client constructor class should be tested.
All unused "using" directives were removed.
This commit is contained in:
@@ -8,19 +8,32 @@ namespace Octokit.Tests.Conventions
|
||||
public class ClientConstructorTests
|
||||
{
|
||||
[Theory]
|
||||
[MemberData("GetTestConstructorsClasses")]
|
||||
public void CheckTestConstructorsNames(Type type)
|
||||
[MemberData("GetTestConstructorClasses")]
|
||||
public void CheckTestConstructorNames(Type type)
|
||||
{
|
||||
const string constructorClassName = "TheCtor";
|
||||
const string constructorTestClassName = "TheCtor";
|
||||
const string constructorTestMethodName = "EnsuresNonNullArguments";
|
||||
|
||||
var classes = new HashSet<string>(type.GetNestedTypes().Select(t => t.Name));
|
||||
|
||||
if (!classes.Contains(constructorClassName))
|
||||
if (!classes.Contains(constructorTestClassName))
|
||||
{
|
||||
throw new MissingClientConstructorTestClassException(type);
|
||||
}
|
||||
|
||||
var ctors = type.GetNestedTypes().Where(t => t.Name == constructorTestClassName)
|
||||
.SelectMany(t => t.GetMethods())
|
||||
.Where(info => info.ReturnType == typeof(void) && info.IsPublic)
|
||||
.Select(info => info.Name);
|
||||
|
||||
var methods = new HashSet<string>(ctors);
|
||||
if (!methods.Contains(constructorTestMethodName))
|
||||
{
|
||||
throw new MissingClientConstructorTestMethodException(type);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> GetTestConstructorsClasses()
|
||||
public static IEnumerable<object[]> GetTestConstructorClasses()
|
||||
{
|
||||
var tests = typeof(GitHubClientTests)
|
||||
.Assembly
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Octokit.Tests.Conventions
|
||||
|
||||
static string CreateMessage(Type ctorTest)
|
||||
{
|
||||
return string.Format("Constructor test method is missing {0}.", ctorTest.FullName);
|
||||
return string.Format("Constructor test class is missing {0}.", ctorTest.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace Octokit.Tests.Conventions
|
||||
{
|
||||
public class MissingClientConstructorTestMethodException : Exception
|
||||
{
|
||||
public MissingClientConstructorTestMethodException(Type modelType)
|
||||
: base(CreateMessage(modelType))
|
||||
{ }
|
||||
|
||||
static string CreateMessage(Type ctorTest)
|
||||
{
|
||||
return string.Format("Constructor test method is missing {0}.", ctorTest.FullName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,7 @@
|
||||
<Compile Include="Exception\InvalidDebuggerDisplayAttributeValueException.cs" />
|
||||
<Compile Include="Exception\InvalidDebuggerDisplayReturnType.cs" />
|
||||
<Compile Include="Exception\MissingClientConstructorTestClassException.cs" />
|
||||
<Compile Include="Exception\MissingClientConstructorTestMethodException.cs" />
|
||||
<Compile Include="Exception\MissingDebuggerDisplayAttributeException.cs" />
|
||||
<Compile Include="Exception\MissingDebuggerDisplayPropertyException.cs" />
|
||||
<Compile Include="Exception\MutableModelPropertiesException.cs" />
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new AssigneesClient(null));
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void ThrowsForBadArgs()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new AuthorizationsClient(null));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
public class CommitsClientTests
|
||||
@@ -71,7 +70,7 @@ public class CommitsClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new CommitsClient(null));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class DeploymentStatusClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new DeploymentStatusClient(null));
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class DeploymentsClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new DeploymentsClient(null));
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new GistCommentsClient(null));
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace Octokit.Tests.Clients
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForGist(""));
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(() => client.GetAllForGist("24", null));
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.GetAllForGist("", ApiOptions.None));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ public class GistsClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new GistsClient(null));
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ public class GitDatabaseClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new GitDatabaseClient(null));
|
||||
}
|
||||
|
||||
@@ -209,14 +209,14 @@ namespace Octokit.Tests.Clients
|
||||
}
|
||||
}
|
||||
|
||||
public class TheCtor
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new IssueCommentsClient(null));
|
||||
}
|
||||
Assert.Throws<ArgumentNullException>(() => new IssueCommentsClient(null));
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanDeserializeIssueComment()
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Clients
|
||||
@@ -240,7 +239,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new IssuesClient(null));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Clients
|
||||
@@ -46,7 +45,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new CommitsClient(null));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Clients
|
||||
@@ -151,7 +150,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new MilestonesClient(null));
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new MiscellaneousClient(null));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public class OauthClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() =>
|
||||
new OauthClient(null));
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Clients
|
||||
@@ -18,7 +17,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsureNonNullArguments()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new OrganizationMembersClient(null));
|
||||
}
|
||||
|
||||
@@ -9,6 +9,12 @@ public class PullRequestReviewCommentsClientTests
|
||||
{
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestReviewCommentsClient(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PullRequestReviewCommentCreateEnsuresArgumentsValue()
|
||||
{
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestsClient(null));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Clients
|
||||
@@ -11,7 +10,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ReferencesClient(null));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() =>
|
||||
new ReleasesClient(null));
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void ThrowsForBadArgs()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new RepoCollaboratorsClient(null));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
public class RepositoryCommentsClientTests
|
||||
@@ -177,7 +176,7 @@ public class RepositoryCommentsClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new RepositoryCommentsClient(null));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void ThrowsForBadArgs()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new RepositoryDeployKeysClient(null));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void ThrowsForBadArgs()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new SshKeysClient(null));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void DoesThrowOnBadArguments()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new StatisticsClient(null));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class TagsClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new TagsClient(null));
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests
|
||||
@@ -108,7 +107,7 @@ namespace Octokit.Tests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new TreesClient(null));
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArguments()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(
|
||||
() => new UserEmailsClient(null));
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
|
||||
@@ -129,7 +128,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArguments()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(
|
||||
() => new UserEmailsClient(null));
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Octokit.Tests.Clients
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void ThrowsForBadArgs()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new UsersClient(null));
|
||||
}
|
||||
|
||||
@@ -11,6 +11,30 @@ namespace Octokit.Tests
|
||||
{
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient((IConnection)null));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient((ProductHeaderValue)null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(new ProductHeaderValue("UnitTest"), (ICredentialStore)null));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, Substitute.For<ICredentialStore>()));
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(new ProductHeaderValue("UnitTest"), (Uri)null));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, new Uri("http://github.com")));
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, (ICredentialStore)null));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, (Uri)null));
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(new ProductHeaderValue("UnitTest"), null, null));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, Substitute.For<ICredentialStore>(), null));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, null, new Uri("http://github.com")));
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(null, Substitute.For<ICredentialStore>(), new Uri("http://github.com")));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(new ProductHeaderValue("UnitTest"), null, new Uri("http://github.com")));
|
||||
Assert.Throws<ArgumentNullException>(() => new GitHubClient(new ProductHeaderValue("UnitTest"), Substitute.For<ICredentialStore>(), null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CreatesAnonymousClientByDefault()
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Octokit.Tests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() =>
|
||||
new ObservableEnterpriseSearchIndexingClient(null));
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
using System;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Reactive;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Reactive
|
||||
@@ -69,7 +67,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableBlobClient(null));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableCommitsClient(null));
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(
|
||||
() => new ObservableDeploymentStatusClient(null));
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArguments()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableDeploymentsClient(null));
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Reactive;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Reactive
|
||||
@@ -192,7 +190,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableIssueCommentsClient(null));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using Octokit;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Reactive;
|
||||
using Octokit.Tests.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reactive.Linq;
|
||||
@@ -390,7 +389,7 @@ public class ObservableIssuesClientTests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new IssuesClient(null));
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Reactive;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Reactive
|
||||
@@ -236,7 +235,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new MilestonesClient(null));
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableMiscellaneousClient((IGitHubClient)null));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Internal;
|
||||
using Octokit.Reactive;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Reactive
|
||||
@@ -352,10 +351,11 @@ namespace Octokit.Tests.Reactive
|
||||
await Assert.ThrowsAsync<ArgumentException>(() => client.Files("owner", "", 1));
|
||||
}
|
||||
}
|
||||
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new PullRequestsClient(null));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableReleasesClient(null));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableRepositoryCommitsClient(null));
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void ThrowsForBadArgs()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableRepositoryDeployKeysClient(null));
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableStarredClient(null));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
using Octokit.Reactive;
|
||||
using Xunit;
|
||||
@@ -38,7 +37,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresNotNullGitHubClient()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableTeamsClient(null));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Octokit.Tests
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgumentIsNotNull()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableTreesClient(null));
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableUserAdministrationClient(null));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using NSubstitute;
|
||||
using Octokit.Reactive;
|
||||
using Xunit;
|
||||
@@ -84,7 +83,7 @@ namespace Octokit.Tests.Reactive
|
||||
public class TheCtor
|
||||
{
|
||||
[Fact]
|
||||
public void EnsuresArgument()
|
||||
public void EnsuresNonNullArguments()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>(() => new ObservableUserKeysClient(null));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user