red: added ReadOnlyPagedCollectionTests.TheConstructor.AcceptsAResponseWithANullBody

This commit is contained in:
Adam Ralph
2015-09-15 12:04:19 +02:00
parent c6c332f5de
commit 4580e0f2a3
4 changed files with 29 additions and 0 deletions
@@ -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);
}
}
}
}