Ejemplo n.º 1
0
        public void SerializeToPrefs()
        {
            Preferences prefs = new Preferences();
            prefs.AddStation("KBFI");

            string serialized = prefs.SaveToString();

            string baked = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<PreferencesData xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n  <stationsArr_>\r\n    <string>KBFI</string>\r\n  </stationsArr_>\r\n</PreferencesData>";

            Assert.AreEqual<string>(baked, serialized);
        }
Ejemplo n.º 2
0
        public void AddStationToPrefs()
        {
            Preferences prefs = new Preferences();
            prefs.AddStation("KBFI");

            List<string> stations = prefs.GetStationsList();

            Assert.AreEqual(1, stations.Count());
            Assert.AreEqual<string>("KBFI", stations[0]);
        }