From 4580e0f2a3ce9734810c957bfee97ac91ca0848c Mon Sep 17 00:00:00 2001 From: Adam Ralph Date: Tue, 15 Sep 2015 12:04:19 +0200 Subject: [PATCH] red: added ReadOnlyPagedCollectionTests.TheConstructor.AcceptsAResponseWithANullBody --- .../Http/ReadOnlyPagedCollectionTests.cs | 26 +++++++++++++++++++ Octokit.Tests/OctoKit.Tests-NetCore45.csproj | 1 + Octokit.Tests/Octokit.Tests-Portable.csproj | 1 + Octokit.Tests/Octokit.Tests.csproj | 1 + 4 files changed, 29 insertions(+) create mode 100644 Octokit.Tests/Http/ReadOnlyPagedCollectionTests.cs diff --git a/Octokit.Tests/Http/ReadOnlyPagedCollectionTests.cs b/Octokit.Tests/Http/ReadOnlyPagedCollectionTests.cs new file mode 100644 index 00000000..c0402023 --- /dev/null +++ b/Octokit.Tests/Http/ReadOnlyPagedCollectionTests.cs @@ -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>>(); + response.Body.Returns((List)null); + + var exception = Record.Exception(() => + new ReadOnlyPagedCollection(response, uri => Task.FromResult(response))); + + Assert.Null(exception); + } + } + } +} diff --git a/Octokit.Tests/OctoKit.Tests-NetCore45.csproj b/Octokit.Tests/OctoKit.Tests-NetCore45.csproj index 3050eb69..b44ea034 100644 --- a/Octokit.Tests/OctoKit.Tests-NetCore45.csproj +++ b/Octokit.Tests/OctoKit.Tests-NetCore45.csproj @@ -128,6 +128,7 @@ + diff --git a/Octokit.Tests/Octokit.Tests-Portable.csproj b/Octokit.Tests/Octokit.Tests-Portable.csproj index e64b0f27..7a6a0efa 100644 --- a/Octokit.Tests/Octokit.Tests-Portable.csproj +++ b/Octokit.Tests/Octokit.Tests-Portable.csproj @@ -126,6 +126,7 @@ + diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index ca3daabc..9c005021 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -145,6 +145,7 @@ +