public void UpdateDeviceSettingUsingUpsertTest() { TestDeviceSetting.DeviceSettingName = TestDeviceSettingName + " updated"; DeviceSettingService.Upsert(TestDeviceSetting, TestUserPrincipal); var foundDeviceSettings = DeviceSettingService.Search(TestDeviceSettingName + " updated").ToList(); Assert.AreEqual(1, foundDeviceSettings.Count); Assert.AreEqual(foundDeviceSettings.First().DeviceSettingName, TestDeviceSetting.DeviceSettingName); }
public void InsertDeviceSettingWithNameThatIsSoftDeletedTest() { TestDeviceSetting.IsDeleted = true; DeviceSettingService.Update(TestDeviceSetting); var newDeviceSetting = new DeviceSetting { DeviceSettingName = TestDeviceSettingName, DeviceSettingValue = TestDeviceSettingValue }; DeviceSettingService.Upsert(newDeviceSetting, TestUserPrincipal); var foundDeviceSettings = DeviceSettingService.Search(TestDeviceSettingName).ToList(); Assert.AreEqual(1, foundDeviceSettings.Count); Assert.AreEqual(foundDeviceSettings.First().DeviceSettingName, TestDeviceSetting.DeviceSettingName); Assert.AreEqual(foundDeviceSettings.First().DeviceSettingValue, TestDeviceSetting.DeviceSettingValue); Assert.IsFalse(foundDeviceSettings.First().IsDeleted); }
public void CreateNewDeviceSettingWithUpsertTest() { var newDeviceSetting = new DeviceSetting { DeviceSettingName = "New Upsert Test Device Setting", DeviceSettingValue = "New Device Setting Upsert Value", OwnedDeviceId = TestOwnedDevice.OwnedDeviceId }; DeviceSettingService.Upsert(newDeviceSetting, TestUserPrincipal); var foundDeviceSettings = DeviceSettingService.Search("New Upsert Test Device Setting").ToList(); Assert.AreEqual(1, foundDeviceSettings.Count); Assert.AreEqual(foundDeviceSettings.First().DeviceSettingName, newDeviceSetting.DeviceSettingName); Assert.AreEqual(foundDeviceSettings.First().DeviceSettingValue, newDeviceSetting.DeviceSettingValue); DeviceSettingService.DeleteByGuid(foundDeviceSettings.First().DeviceSettingId); }
public void InsertDeviceSettingThatAlreadyExistsTest() { TestDeviceSetting.IsDeleted = true; DeviceSettingService.Upsert(TestDeviceSetting, TestUserPrincipal); }