Esempio n. 1
0
        public void SavingDeviceIDTest2()
        {
            LiteDBBaseMock liteDBBaseMock = DeleteAndInitTestDB();

            var deviceId1 = new DeviceId("user", "deviceName");
            var deviceId2 = new DeviceId("user", "deviceName");

            liteDBBaseMock.SaveDeviceId(deviceId1);
            Assert.Throws <LiteDB.LiteException>(() => liteDBBaseMock.SaveDeviceId(deviceId2));
        }
Esempio n. 2
0
        public void SavingDeviceIDTest()
        {
            LiteDBBaseMock liteDBBaseMock = DeleteAndInitTestDB();

            var deviceId1 = new DeviceId("user", "deviceName");
            var deviceId2 = new DeviceId("user", "deviceName2");

            liteDBBaseMock.SaveDeviceId(deviceId1);

            var devicesFromDB = liteDBBaseMock.LoadDeviceId("user", "deviceName");

            Assert.Single(devicesFromDB);
            MyAsserts.Equal(deviceId1, devicesFromDB.First());
            Assert.Equal(deviceId1.FullId, devicesFromDB.First().FullId);
        }