Esempio n. 1
0
 private void RaiseNotification(ZWNotification.Type type, ZWValueID valueId, MockZWaveNode node)
 {
     _configManager.Setup(s => s.FindAllComponentsOfTypeEvenInvalid <ZWaveNode>()).Returns(new List <ZWaveNode> {
         node
     });
     _zWaveManager.Raise(s => s.OnNotification += null, new NotificationEventArgs(_zWaveManager.Object, (byte)1, type, valueId, 2));
 }
Esempio n. 2
0
 public NotificationEventArgs(IZWaveManager manager, byte nodeId, ZWNotification.Type notificationType, ZWValueID valueId, UInt32 homeId)
 {
     Manager          = manager;
     NodeId           = nodeId;
     NotificationType = notificationType;
     ValueId          = valueId;
     HomeId           = homeId;
 }
Esempio n. 3
0
        private MockZWaveNode RaiseNotification(ZWNotification.Type type, bool nodeIsConnected, ZWValueID valueId)
        {
            MockZWaveNode node = new MockZWaveNode();

            node.NodeId      = 1;
            node.IsConnected = nodeIsConnected;
            RaiseNotification(type, valueId, node);
            return(node);
        }
Esempio n. 4
0
        private void TestNoChangeAfterNotification(ZWNotification.Type notificationType)
        {
            ZWaveController controller = SetupInitializedController();

            _configManager.Raise(s => s.InitializationComplete += null, EventArgs.Empty);

            VerifyInitializedController(controller);

            ZWValueID valueId = new ZWValueID(0, 1, ZWValueID.ValueGenre.Basic, 2, 3, 4, ZWValueID.ValueType.Bool, 5);

            RaiseNotificationNoNodes(ZWNotification.Type.ValueChanged, valueId);

            Assert.IsFalse(controller.IsInitialized);
            _configManager.Verify(s => s.FindAllComponentsOfTypeEvenInvalid <ZWaveNode>(), Times.Exactly(1));
        }