예제 #1
0
파일: Chapter.cs 프로젝트: nnug/website
 public Chapter(IMeetupSettings meetupSettings, IHttpGetStringCommand httpGetStringCommand, string meetupGroupUrl, string name, string twitterName)
 {
     _meetupSettings = meetupSettings;
     _httpGetStringCommand = httpGetStringCommand;
     Name = name;
     MeetupGroupUrl = meetupGroupUrl;
     TwitterName = twitterName;
 }
예제 #2
0
 public void SetUp()
 {
     _meetupSettings = Substitute.For<IMeetupSettings>();
     _meetupSettings.GetSignedGroupUri(Arg.Any<string>()).Returns(new Uri("http://api.meetup.com/2/groups?meetupgroupname1"));
     _meetupSettings.GetSignedEventUri(Arg.Any<string>()).Returns(new Uri("http://api.meetup.com/2/events?meetupgroupname1"));
     _httpGetStringCommand = Substitute.For<IHttpGetStringCommand>();
     _httpGetStringCommand.InvokeAsync(Arg.Is<Uri>(u => u.Segments.Last() == "groups")).Returns(Task.FromResult(TestData.MeetupApiResponse.GroupNnugTrondheim));
     _httpGetStringCommand.InvokeAsync(Arg.Is<Uri>(u => u.Segments.Last() == "events")).Returns(Task.FromResult(TestData.MeetupApiResponse.EventsNnugTrondheim));
 }
예제 #3
0
        public static async Task<Organization> Create(IMeetupSettings meetupSettings, IHttpGetStringCommand httpGetStringCommand)
        {
            var organization = new Organization();
            var chapters = new List<Chapter>
                           {
                               //new Chapter(meetupSettings, httpGetStringCommand, "nnug-online", "NNUG Online", "NNUGOnline"),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnugoslo", "NNUG Oslo", "NNUGOslo"),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnug-bergen", "NNUG Bergen", "NNUGBergen"),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnug-trondheim", "NNUG Trondheim", "NNUGTrondheim"),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnug-stavanger", "NNUG Stavanger", "NNUGStavanger"),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnug-kristiansand", "NNUG Kristiansand", ""),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnug-haugesund", "NNUG Haugesund", "NNUGHaugesund"),
                               new Chapter(meetupSettings, httpGetStringCommand, "nnug-vestfold", "NNUG Vestfold", "NNUGVestfold"),
                           };

            foreach (var chapter in chapters)
            {
                await chapter.LoadFromMeetupAsync();
            }

            organization.Chapters = chapters.OrderByDescending(c => c.NumberOfMembers).ToList();

            return organization;
        }
예제 #4
0
파일: MeetupGroup.cs 프로젝트: nnug/website
 public MeetupGroup(IMeetupSettings meetupSettings, IHttpGetStringCommand httpGetStringCommand, string meetupGroupUrl)
 {
     _meetupSettings = meetupSettings;
     _httpGetStringCommand = httpGetStringCommand;
     _meetupGroupUrl = meetupGroupUrl;
 }