Add test for DeviceFactory