public void RemoveDeviceFromConnectedHardwired() { TECControllerType type = new TECControllerType(new TECManufacturer()); TECProvidedController controller = new TECProvidedController(type); TECConnectionType connectionType = new TECConnectionType(); TECDevice device = new TECDevice(new List <TECConnectionType> { connectionType }, new List <TECProtocol>(), new TECManufacturer()); TECSubScope subScope = new TECSubScope(); subScope.Devices.Add(device); TECHardwiredConnection connection = controller.Connect(subScope, subScope.HardwiredProtocol()) as TECHardwiredConnection; subScope.RemoveDevice(device); Assert.IsNull((subScope as IConnectable).GetParentConnection()); Assert.IsFalse(controller.ChildrenConnections.Contains(connection)); }
public void RemoveDeviceFromConnectedNetwork() { TECControllerType type = new TECControllerType(new TECManufacturer()); TECProtocol protocol = new TECProtocol(new List <TECConnectionType>()); type.IO.Add(new TECIO(protocol)); TECProvidedController controller = new TECProvidedController(type); TECDevice device = new TECDevice(new List <TECConnectionType>(), new List <TECProtocol> { protocol }, new TECManufacturer()); TECSubScope subScope = new TECSubScope(); subScope.Devices.Add(device); IControllerConnection connection = controller.Connect(subScope, protocol); subScope.RemoveDevice(device); Assert.IsNull((subScope as IConnectable).GetParentConnection()); Assert.IsTrue(controller.ChildrenConnections.Contains(connection)); }
private void deleteDeviceExecute(IEndDevice device) { toAdd.RemoveDevice(device); }