public async Task GetWithFieldsGeneratesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/tech-nottingham?fields=plain_text_no_images_description") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Groups.Get("tech-nottingham", new [] { "plain_text_no_images_description" }); }
public async Task GetGeneratesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/tech-nottingham") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Groups.Get("tech-nottingham"); }
public async Task StatusCreatesCorrectCall() { var client = FakeHttpClient.AssertUrl("/status"); var defaults = new MeetupClientOptions { Client = client }; var meetup = new MeetupClient(defaults); await meetup.Meta.Status(); }
public async Task FindTopicThrowsIfQueryIsEmpty() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/topics?photo-host=public&query=tech") }; var meetup = MeetupClient.WithApiToken("testToken", options); await Assert.ThrowsAsync <ArgumentNullException>(() => meetup.Topics.Find(string.Empty)); }
public async Task FindTopicUsesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/topics?photo-host=public&query=tech") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Topics.Find("tech"); }
public async Task CreateForGeneratesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/tech-nottingham/venues?fields=taglist", System.Net.Http.HttpMethod.Post) }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Venues.CreateFor("tech-nottingham", new Venue()); }
public async Task FindTopicCategoriesUsesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/topic_categories?photo-host=public") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Topics.FindCategories(); }
public async Task ForGroupGeneratesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/tech-nottingham/venues?fields=taglist") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Venues.For("tech-nottingham"); }
public async Task RecommendedVenueEmptyGeneratesCorrectUrl() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/recommended/venues?fields=taglist") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Venues.Recommended(); }
public async Task RecommendedTopicThrowsIfGroupsListIsEmpty() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/topics?photo-host=public&query=tech") }; var meetup = MeetupClient.WithApiToken("testToken", options); var exception = await Assert.ThrowsAsync <ArgumentNullException>(() => meetup.Topics.RecommendedGroupTopic(new int[] {})); Assert.Equal("basedOnTopics", exception.ParamName); }
public async Task FindVenueOrderedNameGeneratesCorrectUrl() { var request = new FindVenuesRequest("rock city"); var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/venues?text=rock+city&fields=taglist&order=rating") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Venues.Find("rock city", VenueOrderBy.Rating); }
public async Task FindTopicCategoriesUsesRequest() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/topic_categories?photo-host=public&lat=45.3&lon=-1.18&radius=23.4") }; var request = new FindTopicCategoriesRequest { Latitude = 45.3, Longitude = -1.18, MilesRadius = 23.4 }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Topics.FindCategories(request); }
public async Task RsvpForUsesCorrectUrl() { var request = new GetRsvpsRequest("tech-nottingham", "258091947") { Response = RsvpStatus.YesAndNo, OrderBy = RsvpOrderBy.Social, Descending = true }; var querystring = "response=yes%2Cno&order=social&desc=true"; var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/tech-nottingham/events/258091947/rsvps?photo-host=public&" + querystring) }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Rsvps.For(request); }
public async Task RecommendedTopicGeneratesCorrectUrl() { var request = new RecommendedGroupTopicRequest("tech") { LanguageCode = "en_US", OtherTopics = new [] { 45 }, ExcludeTopics = new[] { 123 }, NumberOfResults = 20 }; var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/recommended/group_topics?photo-host=public&text=tech&other_topics=45&exclude_topics=123&lang=en_US&page=20") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Topics.RecommendedGroupTopic(request); }
public async Task LocationFindGeneratesCorrectUrl() { var request = new FindLocationRequest { Name = "bas", Longitude = 57.2, Latitude = -1.18, Page = 1, PageSize = 2 }; var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/location?query=bas&lon=57.2&lat=-1.18&page=2&offset=1") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Geo.FindLocation(request); }
public async Task EventForUsesCorrectUrl() { var request = new GetEventsRequest("tech-nottingham") { NoLaterThan = new DateTime(2018, 01, 01).AddMonths(1), NoEarlierThan = new DateTime(2018, 01, 01).AddDays(1), PageSize = 20, ScrollTo = EventScrollTo.recent_past, Status = EventStatus.Past | EventStatus.Upcoming, Descending = true }; var querystring = "no_earlier_than=2018-01-02T00%3A00%3A00&no_later_than=2018-02-01T00%3A00%3A00&page=20&scroll=recent_past&status=past%2Cupcoming&desc=true"; var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/tech-nottingham/events?photo-host=public&" + querystring) }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Events.For(request); }
public async Task FindVenueRequestGeneratesCorrectUrl() { var request = new FindVenuesRequest("rock city") { Country = "UK", Latitude = 2.3, Longitude = 20.5, Location = "nottingham", MilesRadius = 25.6, Zip = "NG6", Descending = true, OrderBy = VenueOrderBy.Rating_Count }; var options = new MeetupClientOptions { Client = FakeHttpClient.AssertUrl("/find/venues?text=rock+city&fields=taglist&country=UK&lat=2.3&lon=20.5&location=nottingham&radius=25.6&zip=NG6&order=rating_count&desc=true") }; var meetup = MeetupClient.WithApiToken("testToken", options); await meetup.Venues.Find(request); }
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); }