Esempio n. 1
0
        public void SerializeJsonTree()
        {
            string filePath = "..\\Data\\Test.json";

            Radio4 radio = JsonConvert.DeserializeObject<Radio4>(File.ReadAllText(filePath));
            var radioList = new RadioProgrammeList(radio).Programmes;

            Assert.IsTrue(radioList.Count > 1, "tree building");

            var item = radioList[0];
            Assert.IsTrue(item.Title == "Midnight News", "display_titles title");
            Assert.IsTrue(item.Subtitle == "12/10/2015", "display_titles subtitle");
            Assert.IsTrue(item.ShortSynopsis == "The latest national and international news from BBC Radio 4.", "programme short_synopsis");
            Assert.IsTrue(item.Start == DateTime.Parse("2015-10-12T01:00:00+02:00"), "broadcast start");
            Assert.IsTrue(item.End == DateTime.Parse("2015-10-12T01:15:00+02:00"), "broadcast end");
        }
Esempio n. 2
0
        void RefreshPrograms()
        {
            try
            {
                isCanRefresh = false;

                Programmes = new RadioProgrammeList().Programmes;
                SelectedRadioProgramme = programmes.FirstOrDefault();

                isCanRefresh = true;
            }
            catch (System.Exception ex)
            {
                MessageBoxHelper.ShowMessage("Refresh eror", ex.Message);
            }
            finally
            {
                isCanRefresh = true;
            }
        }