Exemplo n.º 1
0
 public async Task Meetup_group_information_can_not_be_retrieved_when_communication_with_meetup_dot_com_fails()
 {
     _httpGetStringCommand = Substitute.For<IHttpGetStringCommand>();
     _httpGetStringCommand.InvokeAsync(Arg.Any<Uri>()).Returns(u => { throw new HttpRequestException("Dummy"); });
     _organization = await Organization.Create(_meetupSettings, _httpGetStringCommand);
     Assert.That(_organization.Chapters.First().MeetupGroup, Is.Null);
 }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
 public async Task NNUG_has_seven_chapters()
 {
     _organization = await Organization.Create(_meetupSettings, _httpGetStringCommand);
     Assert.That(_organization.Chapters.Count, Is.EqualTo(7));
 }