コード例 #1
0
        private void reinitializeChildViewModels()
        {
            OverviewViewModel = new OverviewViewModel(Messenger, _campService);
            OverviewViewModel.Init();

            SessionsViewModel = new SessionsViewModel(Messenger, _campService);
            SessionsViewModel.Init();

            SpeakersViewModel = new SpeakersViewModel(Messenger, _campService);
            SpeakersViewModel.Init();

            SponsorsViewModel = new SponsorsViewModel(Messenger, _campService);
            SponsorsViewModel.Init();
        }
コード例 #2
0
        public async void Init_SomeSessionsHaveEnded_LoadsNextUnfinishedSlots()
        {
            var speaker = new Speaker {Id = 1};
            var pastSession = new Session { StartTime = DateTime.UtcNow.AddHours(-1), EndTime = DateTime.UtcNow.AddHours(-1), Id = 42, SpeakerId = speaker.Id};
            var inProgressSession = new Session { StartTime = DateTime.UtcNow.AddMinutes(-10), EndTime = DateTime.UtcNow.AddHours(1), Id = 24 };
            var data = new CampData
                           {
                               Sessions = new List<Session> {inProgressSession, pastSession},
                               Speakers = new List<Speaker> {speaker}
                           };
            DataClient.GetDataBody = () => Task.FromResult(data);
            var viewModel = new OverviewViewModel(Messenger, CodeCampService);

            await viewModel.Init();

            Assert.AreEqual(1, viewModel.TimeSlots.Count);
            Assert.AreEqual(inProgressSession, viewModel.TimeSlots.First().Sessions.Single());
        }