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

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, (TeamMembersRequest)null));

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, (ApiOptions)null));

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, null, ApiOptions.None));

                await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAllMembers(1, new TeamMembersRequest(TeamRoleFilter.All), null));
            }
            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new TeamsClient(connection);

                client.GetAllMembers(1);

                connection.Received().GetAll <User>(Arg.Is <Uri>(u => u.ToString() == "teams/1/members"));
            }
            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For<IApiConnection>();
                var client = new TeamsClient(connection);

                client.GetAllMembers(1);

                connection.Received().GetAll<User>(Arg.Is<Uri>(u => u.ToString() == "teams/1/members"));
            }
Exemple #4
0
            public void RequestsTheCorrectUrlWithRequest()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new TeamsClient(connection);

                client.GetAllMembers(1, new TeamMembersRequest(TeamRoleFilter.Maintainer));

                connection.Received().GetAll <User>(
                    Arg.Is <Uri>(u => u.ToString() == "teams/1/members"),
                    Arg.Is <Dictionary <string, string> >(d => d["role"] == "maintainer"),
                    Args.ApiOptions);
            }
Exemple #5
0
            public void RequestsTheCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new TeamsClient(connection);

                client.GetAllMembers(1);

                connection.Received().GetAll <User>(
                    Arg.Is <Uri>(u => u.ToString() == "teams/1/members"),
                    null,
                    "application/vnd.github.hellcat-preview+json",
                    Args.ApiOptions);
            }