コード例 #1
0
            public async Task EnsuresNonNullArguments()
            {
                var client     = new ObservableProjectsClient(Substitute.For <IGitHubClient>());
                var newProject = new NewProject("someName");

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.CreateForRepository(1, null).ToTask());
            }
コード例 #2
0
            public void PostsToCorrectURL()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableProjectsClient(gitHubClient);
                var newProject   = new NewProject("someName");

                client.CreateForRepository(1, newProject);

                gitHubClient.Repository.Project.Received().CreateForRepository(1, newProject);
            }