Пример #1
0
            public async Task EnsuresNonNullArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);

                AssertEx.Throws<ArgumentNullException>(async () => await
                    client.CreateTeam("", new NewTeam("superstars")));
                AssertEx.Throws<ArgumentException>(async () => await
                    client.CreateTeam("name", null));
            }
Пример #2
0
            public void EnsuresNonNullArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new TeamsClient(connection);
                var team       = new NewTeam("superstars");

                Assert.Throws <ArgumentNullException>(() => client.CreateTeam(null, team));
                Assert.Throws <ArgumentException>(() => client.CreateTeam("", team));
                Assert.Throws <ArgumentNullException>(() => client.CreateTeam("name", null));
            }
Пример #3
0
            public void EnsuresNonNullArguments()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);
                var team = new NewTeam("superstars");

                Assert.Throws<ArgumentNullException>(() => client.CreateTeam(null, team));
                Assert.Throws<ArgumentException>(() => client.CreateTeam("", team));
                Assert.Throws<ArgumentNullException>(() => client.CreateTeam("name", null));
            }
Пример #4
0
            public async Task EnsuresNonNullArguments()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new TeamsClient(connection);

                AssertEx.Throws <ArgumentNullException>(async() => await
                                                        client.CreateTeam("", new NewTeam("superstars")));
                AssertEx.Throws <ArgumentException>(async() => await
                                                    client.CreateTeam("name", null));
            }
Пример #5
0
            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);
                var team = new NewTeam("Octokittens");

                client.CreateTeam("orgName", team);

                connection.Received().Post<Team>(Arg.Is<Uri>(u => u.ToString() == "orgs/orgName/teams"), team);
            }
Пример #6
0
            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new TeamsClient(connection);
                var team       = new NewTeam("Octokittens");

                client.CreateTeam("orgName", team);

                connection.Received().Post <Team>(Arg.Is <Uri>(u => u.ToString() == "orgs/orgName/teams"), team);
            }