public void EnsuresNonNullArguments()
            {
                var releasesClient = new ObservableReleasesClient(Substitute.For<IGitHubClient>());
                var update = new ReleaseUpdate("tag");

                Assert.Throws<ArgumentNullException>(() => releasesClient.EditRelease(null, "name", 1, update));
                Assert.Throws<ArgumentException>(() => releasesClient.EditRelease("", "name", 1, update));
                Assert.Throws<ArgumentNullException>(() => releasesClient.EditRelease("owner", null, 1, update));
                Assert.Throws<ArgumentException>(() => releasesClient.EditRelease("owner", "", 1, update));
                Assert.Throws<ArgumentNullException>(() => releasesClient.EditRelease("owner", "name", 1, null));
            }
            public async Task EnsuresNonNullArguments()
            {
                var releasesClient = new ObservableReleasesClient(Substitute.For<IGitHubClient>());

                AssertEx.Throws<ArgumentNullException>(async () => await releasesClient.EditRelease(null, "name", new ReleaseUpdate("tag")));
                AssertEx.Throws<ArgumentException>(async () => await releasesClient.EditRelease("", "name", new ReleaseUpdate("tag")));
                AssertEx.Throws<ArgumentNullException>(async () => await releasesClient.EditRelease("owner", null, new ReleaseUpdate("tag")));
                AssertEx.Throws<ArgumentException>(async () => await releasesClient.EditRelease("owner", "", new ReleaseUpdate("tag")));
                AssertEx.Throws<ArgumentNullException>(async () => await releasesClient.EditRelease("owner", "name", null));
            }
            public void RequestsTheCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var releasesClient = new ObservableReleasesClient(gitHubClient);
                var data = new ReleaseUpdate("fake-tag");

                releasesClient.EditRelease("fake", "repo", 1, data);

                gitHubClient.Release.Received(1).EditRelease("fake", "repo", 1, data);
            }
            public void RequestsTheCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var releasesClient = new ObservableReleasesClient(gitHubClient);
                var data = new ReleaseUpdate("fake-tag");

                releasesClient.EditRelease("fake", "repo", data);

                gitHubClient.Connection.PatchAsync<Release>(
                    new Uri("repos/fake/repo/releases", UriKind.Relative), data);
            }