public void Sync_GetUsbStatusLink_NoUsb() { var usbLocator = new MockUsbDriveLocator(); usbLocator.Init(0); // pretend no USBs string message; var syncStartModel = new SyncStartModel(null); var result = syncStartModel.GetUsbStatusLink(usbLocator, out message); Assert.IsFalse(result, "Should fail!"); Assert.AreEqual("First insert a USB flash drive.", message); }
public void Sync_GetUsbStatusLink_OneUsb() { var usbLocator = new MockUsbDriveLocator(); usbLocator.Init(1); // pretend only one USB string message; var syncStartModel = new SyncStartModel(null); var result = syncStartModel.GetUsbStatusLink(usbLocator, out message); Assert.IsTrue(result, "Should pass!"); Assert.IsTrue(message.StartsWith("C:")); }
public void Sync_GetUsbStatusLink_MultipleUsb() { var usbLocator = new MockUsbDriveLocator(); usbLocator.Init(2); // pretend 2 USBs string message; var syncStartModel = new SyncStartModel(null); var result = syncStartModel.GetUsbStatusLink(usbLocator, out message); Assert.IsFalse(result, "Should fail!"); Assert.AreEqual("More than one USB drive detected. Please remove one.", message); }