コード例 #1
0
        public Task <MeetupResponse <Venue[]> > Recommended(RecommendedVenuesRequest request)
        {
            if (!string.IsNullOrWhiteSpace(request?.Country) && request.Country.Length != 2)
            {
                throw new ArgumentOutOfRangeException(nameof(request), "Country must be a 2 character code");
            }

            return(Recommended(request ?? MeetupRequest.FieldsOnly("taglist")));
        }
コード例 #2
0
        public async Task RecommendedVenueRequestGeneratesCorrectUrl()
        {
            var request = new RecommendedVenuesRequest {
                Categories    = new [] { "testcat1", "testcat2" },
                Country       = "UK",
                GroupIds      = new[] { "testgroup1", "testgroup2" },
                GroupNames    = new[] { "testname1", "testname2" },
                Latitude      = 56.7,
                Longitude     = -1.18,
                Location      = "Nottingham",
                MinimumGroups = 5,
                MilesRadius   = 30.5,
                UsedBetween   = new MeetupTimeSpan("1m", "2m"),
                Zip           = "NG120FF"
            };

            var options = new MeetupClientOptions
            {
                Client = FakeHttpClient.AssertUrl("/recommended/venues?fields=taglist&category=testcat1%2Ctestcat2&country=UK&group_id=testgroup1%2Ctestgroup2&group_urlname=testname1%2Ctestname2&lat=56.7&lon=-1.18&location=Nottingham&min_groups=5&radius=30.5&used_between=1m%2C2m&zip=NG120FF")
            };

            var meetup = MeetupClient.WithApiToken("tokenToken", options);
            await meetup.Venues.Recommended(request);
        }