Пример #1
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableRepositoryForksClient(Substitute.For <IGitHubClient>());

                Assert.Throws <ArgumentNullException>(() => client.Create(null, "name", new NewRepositoryFork()));
                Assert.Throws <ArgumentNullException>(() => client.Create("owner", null, new NewRepositoryFork()));
                Assert.Throws <ArgumentNullException>(() => client.Create("owner", "name", null));

                Assert.Throws <ArgumentException>(() => client.Create("", "name", new NewRepositoryFork()));
                Assert.Throws <ArgumentException>(() => client.Create("owner", "", new NewRepositoryFork()));
            }
Пример #2
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableRepositoryForksClient(gitHubClient);

                var newRepositoryFork = new NewRepositoryFork();

                client.Create("fake", "repo", newRepositoryFork);

                gitHubClient.Received().Repository.Forks.Create("fake", "repo", newRepositoryFork);
            }