mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-05 23:06:10 +00:00
red: added ReadOnlyPagedCollectionTests.TheConstructor.AcceptsAResponseWithANullBody
This commit is contained in:
26
Octokit.Tests/Http/ReadOnlyPagedCollectionTests.cs
Normal file
26
Octokit.Tests/Http/ReadOnlyPagedCollectionTests.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Octokit.Internal;
|
||||
using NSubstitute;
|
||||
using Xunit;
|
||||
|
||||
namespace Octokit.Tests.Http
|
||||
{
|
||||
public class ReadOnlyPagedCollectionTests
|
||||
{
|
||||
public class TheConstructor
|
||||
{
|
||||
[Fact]
|
||||
public void AcceptsAResponseWithANullBody()
|
||||
{
|
||||
var response = Substitute.For<IApiResponse<List<string>>>();
|
||||
response.Body.Returns((List<string>)null);
|
||||
|
||||
var exception = Record.Exception(() =>
|
||||
new ReadOnlyPagedCollection<string>(response, uri => Task.FromResult(response)));
|
||||
|
||||
Assert.Null(exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,6 +128,7 @@
|
||||
<Compile Include="Authentication\TokenAuthenticatorTests.cs" />
|
||||
<Compile Include="Http\ConnectionTests.cs" />
|
||||
<Compile Include="Http\RateLimitTests.cs" />
|
||||
<Compile Include="Http\ReadOnlyPagedCollectionTests.cs" />
|
||||
<Compile Include="Http\ResponseTests.cs" />
|
||||
<Compile Include="Http\RequestTests.cs" />
|
||||
<Compile Include="Models\DeploymentStatusTests.cs" />
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
<Compile Include="Authentication\TokenAuthenticatorTests.cs" />
|
||||
<Compile Include="Http\ConnectionTests.cs" />
|
||||
<Compile Include="Http\RateLimitTests.cs" />
|
||||
<Compile Include="Http\ReadOnlyPagedCollectionTests.cs" />
|
||||
<Compile Include="Http\ResponseTests.cs" />
|
||||
<Compile Include="Http\RequestTests.cs" />
|
||||
<Compile Include="Models\DeploymentStatusTests.cs" />
|
||||
|
||||
@@ -145,6 +145,7 @@
|
||||
<Compile Include="Http\ConnectionTests.cs" />
|
||||
<Compile Include="Http\RateLimitTests.cs" />
|
||||
<Compile Include="Http\RedirectHandlerTests.cs" />
|
||||
<Compile Include="Http\ReadOnlyPagedCollectionTests.cs" />
|
||||
<Compile Include="Http\ResponseTests.cs" />
|
||||
<Compile Include="Http\RequestTests.cs" />
|
||||
<Compile Include="Models\DeploymentStatusTests.cs" />
|
||||
|
||||
Reference in New Issue
Block a user