示例#1
0
            public async Task RequestsCorrectUrl()
            {
                var connection = Substitute.For <IApiConnection>();
                var client     = new UsersClient(connection);

                await client.GetByName("name");

                Received.InOrder(async() =>
                {
                    await connection.GetAll <User>(Arg.Is <Uri>(u => u.ToString() == "users/find"),
                                                   Arg.Is <Dictionary <string, string> >(d => d.Count == 2 &&
                                                                                         d["term"] == "name" &&
                                                                                         d["search_by_email"] == "0"));
                });
            }