示例#1
0
        public void IncludeConferenceWithOnlyMorningSessionTrackSuccessfully()
        {
            var stringTalkList = new List <string>();

            stringTalkList.Add("Clojure Ate Scala(on my project) 45min");
            stringTalkList.Add("Programming in the Boondocks of Seattle 30min");
            stringTalkList.Add("Ruby vs.Clojure for Back - End Development 30min");
            stringTalkList.Add("User Interface CSS in Rails Apps 30min");
            var talkService = new TalkService();
            var talks       = new List <Talk>();

            foreach (var item in stringTalkList)
            {
                talks.Add(talkService.IncludeTalk(item));
            }
            var service    = new ConferenceService();
            var conference = service.ScheduleTalks(talks);

            Assert.IsTrue(conference != null &&
                          conference.Tracks.Count == 1 &&
                          conference.Tracks[0].HasNetworking == false &&
                          conference.Tracks[0].MorningTalks.Count > 0 &&
                          conference.Tracks[0].AfternoonTalks.Count == 0 &&
                          string.IsNullOrWhiteSpace(service.Error));
        }
示例#2
0
        public void Initialize()
        {
            var stringTalkList = new List <string>();

            stringTalkList.Add("Writing Fast Tests Against Enterprise Rails 60min");
            stringTalkList.Add("Overdoing it in Python 45min");
            stringTalkList.Add("Lua for the Masses 30min");
            stringTalkList.Add("Ruby Errors from Mismatched Gem Versions 45min");
            stringTalkList.Add("Common Ruby Errors 45min");
            stringTalkList.Add("Communicating Over Distance 60min");
            stringTalkList.Add("Rails for Python Developers lightning");
            stringTalkList.Add("Accounting - Driven Development 45min");
            stringTalkList.Add("Woah 30min");
            stringTalkList.Add("Sit Down and Write 30min");
            stringTalkList.Add("Pair Programming vs Noise 45min");
            stringTalkList.Add("Rails Magic 60min");
            stringTalkList.Add("Ruby on Rails: Why We Should Move On 60min");
            stringTalkList.Add("Clojure Ate Scala(on my project) 45min");
            stringTalkList.Add("Programming in the Boondocks of Seattle 30min");
            stringTalkList.Add("Ruby vs.Clojure for Back - End Development 30min");
            stringTalkList.Add("Ruby on Rails Legacy App Maintenance 60min");
            stringTalkList.Add("A World Without HackerNews 30min");
            stringTalkList.Add("User Interface CSS in Rails Apps 30min");
            var talkService = new TalkService();

            foreach (var item in stringTalkList)
            {
                DefaultTalks.Add(talkService.IncludeTalk(item));
            }
        }
示例#3
0
        public void IncludeConferenceWithOneTrackSuccessfully()
        {
            var stringTalkList = new List <string>();

            stringTalkList.Add("Rails Magic 60min");
            stringTalkList.Add("Ruby on Rails: Why We Should Move On 60min");
            stringTalkList.Add("Clojure Ate Scala(on my project) 45min");
            stringTalkList.Add("Programming in the Boondocks of Seattle 30min");
            stringTalkList.Add("Ruby vs.Clojure for Back - End Development 30min");
            stringTalkList.Add("Ruby on Rails Legacy App Maintenance 60min");
            stringTalkList.Add("A World Without HackerNews 30min");
            stringTalkList.Add("User Interface CSS in Rails Apps 30min");
            var talkService = new TalkService();
            var talks       = new List <Talk>();

            foreach (var item in stringTalkList)
            {
                talks.Add(talkService.IncludeTalk(item));
            }
            var service    = new ConferenceService();
            var conference = service.ScheduleTalks(talks);

            Assert.IsTrue(conference != null &&
                          conference.Tracks.Count == 1 &&
                          string.IsNullOrWhiteSpace(service.Error));
        }
        public void DontIncludeTalkWithTitleNull()
        {
            var talkService = new TalkService();
            var talk        = talkService.IncludeTalk(null);

            Assert.IsTrue(talk == null && !string.IsNullOrWhiteSpace(talkService.Error));
        }
        public void DontIncludeTalkWithInvalidTitle()
        {
            var talkService = new TalkService();
            var talk        = talkService.IncludeTalk("Java 1 60min");

            Assert.IsTrue(talk == null && !string.IsNullOrWhiteSpace(talkService.Error));
        }
        public void IncludeLightningSuccessfully()
        {
            var talkService = new TalkService();
            var lightning   = talkService.IncludeTalk("Rails for Python Developers lightning");

            Assert.IsTrue(lightning != null && lightning.Duration == 5 && lightning.DurationFormat == "Lightning");
        }
        public void IncludeTalkSuccessfully()
        {
            var talkService = new TalkService();
            var talk        = talkService.IncludeTalk("Writing Fast Tests Against Enterprise Rails 60min");

            Assert.IsTrue(talk != null && string.IsNullOrWhiteSpace(talkService.Error));
        }
示例#8
0
        public void VisualizeScheduleOfConferenceWithOnlyMorningSessionTrackSuccessfully()
        {
            var stringTalkList = new List <string>();

            stringTalkList.Add("Clojure Ate Scala(on my project) 45min");
            stringTalkList.Add("Programming in the Boondocks of Seattle 30min");
            stringTalkList.Add("Ruby vs.Clojure for Back - End Development 30min");
            stringTalkList.Add("User Interface CSS in Rails Apps 30min");
            var talkService = new TalkService();
            var talks       = new List <Talk>();

            foreach (var item in stringTalkList)
            {
                talks.Add(talkService.IncludeTalk(item));
            }
            var service    = new ConferenceService();
            var conference = service.ScheduleTalks(talks);
            var schedule   = service.VisualizeSchedule(conference);

            Assert.IsTrue(!string.IsNullOrWhiteSpace(schedule.ToString()) &&
                          string.IsNullOrWhiteSpace(service.Error));
        }
示例#9
0
        static void Main(string[] args)
        {
            Console.WriteLine("Inform a talk list:\n\n");
            string line;
            var    talks             = new List <Talk>();
            var    conferenceService = new ConferenceService();
            var    talkService       = new TalkService();

            while ((line = Console.ReadLine()).Any())
            {
                var talk = talkService.IncludeTalk(line);
                if (talk == null)
                {
                    Console.WriteLine(talkService.Error);
                    continue;
                }
                talks.Add(talk);
            }
            var conference = conferenceService.ScheduleTalks(talks);

            if (conference == null)
            {
                Console.WriteLine(conferenceService.Error);
                return;
            }
            var schedule = conferenceService.VisualizeSchedule(conference);

            if (schedule == null)
            {
                Console.WriteLine(conferenceService.Error);
            }
            else
            {
                Console.WriteLine(schedule.ToString());
            }
        }