Пример #1
0
        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.That(result, Is.True, "Should pass!");
            Assert.That(message.StartsWith("C:"), Is.True);
        }
Пример #2
0
        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.That(result, Is.False, "Should fail!");
            Assert.AreEqual("More than one USB drive detected. Please remove one.", message);
        }
Пример #3
0
        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.That(result, Is.False, "Should fail!");
            Assert.AreEqual("First insert a USB flash drive.", message);
        }
Пример #4
0
        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:"));
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }