public void TestSensorsProp()
        {
            PropertiesCollection coll = new PropertiesCollection();

            coll.SetValue(DynamicPropertyManagers.Sensors.MileageKm, 3.4f);
            coll.SetValue(DynamicPropertyManagers.Sensors.SpeedKmh, 3.2f);
            coll.SetValue(DynamicPropertyManagers.Sensors.IsEngineRunning, true);

            Assert.AreEqual(3.2f, coll.GetValue(DynamicPropertyManagers.Sensors.SpeedKmh));
            Assert.AreEqual(3.4f, coll.GetValue(DynamicPropertyManagers.Sensors.MileageKm));
            Assert.AreEqual(true, coll.GetValue(DynamicPropertyManagers.Sensors.IsEngineRunning));
        }
示例#2
0
        public void TestRuntimePropRegister()
        {
            DynamicPropertyManagers.Sensors.RegisterProperty(new SensorProperty("test", typeof(bool)));
            var z = DynamicPropertyManagers.Sensors.GetProperty("test");

            Assert.IsNotNull(z);

            PropertiesCollection coll = new PropertiesCollection();

            coll.SetValue(z, true);
            Assert.AreEqual(true, coll.GetValue(z));
        }