Exemplo n.º 1
0
        internal static PlantSettings Create()
        {
            var result = new PlantSettings();
            result.InverterEuroMapping = new SerializableDictionary<int, double>();

            return result;
        }
Exemplo n.º 2
0
        public void XMLSerializerTest()
        {
            MyXmlSerializer<PlantSettings> serializer = new MyXmlSerializer<PlantSettings>();
              PlantSettings settings = new PlantSettings();
              settings.PlantVisibility = E_PlantVisibility.OwnersOnly;
              settings.InverterEuroMapping = new SerializableDictionary<int, double>();
              settings.InverterEuroMapping.Add(1, 2.5);
              settings.InverterEuroMapping.Add(2, 3.5);

              string actual = serializer.SerializeObject(settings);
              Console.Write(actual);

              PlantSettings result = serializer.DeserializeObject(actual);
              Assert.AreEqual(E_PlantVisibility.OwnersOnly, result.PlantVisibility);
        }