Exemple #1
0
            public async Task EnsuresNonEmptyArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckSuitesClient(connection);

                var preferences = new CheckSuitePreferences(new[] { new CheckSuitePreferenceAutoTrigger(123, true) });

                await Assert.ThrowsAsync <ArgumentException>(() => client.UpdatePreferences("", "repo", preferences));

                await Assert.ThrowsAsync <ArgumentException>(() => client.UpdatePreferences("fake", "", preferences));
            }
Exemple #2
0
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new CheckSuitesClient(connection);

                var preferences = new CheckSuitePreferences(new[] { new CheckSuitePreferenceAutoTrigger(123, true) });

                await client.UpdatePreferences(1, preferences);

                connection.Received().Patch <CheckSuitePreferencesResponse>(
                    Arg.Is <Uri>(u => u.ToString() == "repositories/1/check-suites/preferences"),
                    preferences,
                    "application/vnd.github.antiope-preview+json");
            }