public void RetrieveDeviceFromTask() { Devices device = TasksRepository.RetrieveByPK(task1WithSchedule).Device; JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings(); jsonSerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; Console.Write(JsonConvert.SerializeObject(device, jsonSerializerSettings)); Assert.NotNull(device); }
public void RetrieveByPK() { Tasks tasks = TasksRepository.RetrieveByPK(task3Update); JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings(); jsonSerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; Console.Write(JsonConvert.SerializeObject(tasks, jsonSerializerSettings)); Assert.NotNull(tasks); }
public void Delete() { Tasks tasks = TasksRepository.RetrieveByPK(task2Delete); if (tasks != null) { TasksRepository.Delete(tasks); } Assert.Greater(TasksRepository.SaveChanges(), 0); }
public void Update() { Tasks tasks = TasksRepository.RetrieveByPK(task3Update); tasks.TaskData.Add(new TaskData { Data = "{\"name\":\"OnePlus 52\"}" }); tasks.DateModified = DateTime.Now; TasksRepository.Update(tasks); Assert.Greater(TasksRepository.SaveChanges(), 0); }