public async Task FindTopicCategoriesUsesDataCorrectly() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("TopicCategory") }; var meetup = MeetupClient.WithApiToken("TestToken", options); var topics = await meetup.Topics.FindCategories(); Assert.NotNull(topics.Data); Assert.Equal(3, topics.Data.Length); var topic = topics.Data.Skip(1).First(); Assert.Equal("Tech", topic.Name); Assert.Equal("tech", topic.ShortName); Assert.Equal("Tech", topic.SortName); Assert.Equal(292, topic.Id); Assert.Single(topic.CategoryIds); Assert.NotNull(topic.Photo); Assert.Equal(450131949, topic.Photo.Id); Assert.Equal(MeetupPhotoType.Event, topic.Photo.Type); Assert.Equal("https://secure.meetupstatic.com/", topic.Photo.BaseUrl.ToString()); Assert.Equal("https://secure.meetupstatic.com/photos/event/2/e/a/d/highres_450131949.jpeg", topic.Photo.HighRes.ToString()); Assert.Equal("https://secure.meetupstatic.com/photos/event/2/e/a/d/600_450131949.jpeg", topic.Photo.Photo.ToString()); Assert.Equal("https://secure.meetupstatic.com/photos/event/2/e/a/d/thumb_450131949.jpeg", topic.Photo.Thumb.ToString()); }
public async Task LocationFindGeneratesCorrectResponse() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("FindLocation") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Geo.FindLocation(string.Empty); Assert.Equal(5, response.Data.Length); }
public async Task StatusDeserialisesCorrectly() { var defaults = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("StatusResponse") }; var meetup = new MeetupClient(defaults); var meetupResponse = await meetup.Meta.Status(); var statusResponse = meetupResponse.Data; Assert.Equal("test message", statusResponse.Message); Assert.Equal("test title", statusResponse.Title); Assert.Equal(ApiStatus.Unavailable, statusResponse.ApiStatus); }
public async Task RsvpParsesDataCorrectly() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("Rsvps") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Rsvps.For("tech-nottingham", "258091947"); Assert.Single(response.Data); var rsvpData = response.Data.First(); Assert.Equal("yes", rsvpData.Response); Assert.Equal("coorganizer", rsvpData.Member.Role); }
public async Task GetGeneratesCorrectData() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("Group") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Groups.Get("tech-nottingham"); var data = response.Data; Assert.Equal(14171002, data.Id); Assert.Equal("Tech Nottingham", data.Name); Assert.Equal(MeetupVisibility.Public, data.Visibility); Assert.NotNull(data.Organizer); Assert.Equal(202648061, data.Organizer.Id); }
public async Task FindVenueParsesData() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("FindVenues") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Venues.Find("test"); Assert.Equal(3, response.Data.Length); var sample = response.Data.First(); Assert.Equal(10, sample.Tags.Length); Assert.Equal(VenueVisibility.Public, sample.Visibility); Assert.Equal("Quartet statue", sample.Name); }
public async Task LocationPropertiesAreAccurate() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("FindLocation") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Geo.FindLocation(string.Empty); var location = response.Data[2]; Assert.Equal("Stratford ", location.City); Assert.Equal("gb", location.Country); Assert.Equal("United Kingdom", location.LocalizedCountryName); Assert.Equal("Stratford , England, United Kingdom", location.FullName); Assert.Equal("E15", location.Zip); Assert.Equal(51.54, location.Latitude); Assert.Equal(0.01, location.Longitude); }
public async Task FindTopicUsesDataCorrectly() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("Topics") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Topics.Find("tech"); Assert.Equal(3, response.Data.Length); var topic = response.Data.Skip(1).First(); Assert.Equal(10579, topic.Id); Assert.Equal("Technology", topic.Name); Assert.Equal("technology", topic.UrlKey); Assert.Equal("Meetup with other people interested in the internet and technology!", topic.Description); Assert.Equal(6981, topic.GroupCount); Assert.Equal(4927597, topic.MemberCount); Assert.Equal("en_US", topic.LanguageCode); }
public async Task EventParsesDataCorrectly() { var options = new MeetupClientOptions { Client = FakeHttpClient.AssertResponse("Events") }; var meetup = MeetupClient.WithApiToken("testToken", options); var response = await meetup.Events.For("tech-nottingham"); Assert.Single(response.Data); var eventData = response.Data.First(); Assert.Equal("Tech Nottingham August 2018: Secure Signups and Visual Testing", eventData.Name); Assert.Equal(84, eventData.RSVPYesCount); Assert.NotNull(eventData.Venue); Assert.Equal("Beck Street", eventData.Venue.Address1); Assert.False(eventData.Venue.Repinned); Assert.Equal(9000000, eventData.DurationMilliseconds); Assert.NotNull(eventData.Group); Assert.Equal("Techies", eventData.Group.Who); Assert.Equal(MeetupVisibility.Public, eventData.Visibility); }