public async void UpdateOne() { int taskid = 1; ServiceTask UpdateData = new ServiceTask { TargetId = 1, Description = "Edited", Closed = true }; IServiceTaskService serviceTaskService = new ServiceTaskService(); await serviceTaskService.UpdateAsync(UpdateData, taskid); var sts = (await serviceTaskService.GetAllAsync()).ToList(); foreach (var st in sts) { if (st.TaskId == taskid) { Assert.Equal(1, st.TargetId); Assert.Equal("Edited", st.Description); Assert.True(st.Closed); } } }
public async void CreateOne() { ServiceTask newTask = new ServiceTask { Closed = false, TargetId = 13, Description = "Find this", Criticality = TaskCriticality.Critical }; IServiceTaskService serviceTaskService = new ServiceTaskService(); await serviceTaskService.CreateAsync(newTask); var sts = (await serviceTaskService.GetAsync(13)).ToList(); Assert.NotEmpty(sts); foreach (var st in sts) { if (st.Description == "Find this") { Assert.False(st.Closed); Assert.Equal(TaskCriticality.Critical, st.Criticality); return; } } Assert.Equal(0, 1); }
public async void NonExistingTasksForTarget() { IServiceTaskService serviceTaskService = new ServiceTaskService(); int fdId = 1; var sts = (await serviceTaskService.GetAsync(fdId)).ToList(); Assert.Empty(sts); }
public async void ExistingTasksForTarget() { IServiceTaskService serviceTaskService = new ServiceTaskService(); int fdId = 11; var sts = (await serviceTaskService.GetAsync(fdId)).ToList(); Assert.NotNull(sts); Assert.Equal(2, sts.Count); }
public async void AllTasks() { IServiceTaskService serviceTaskService = new ServiceTaskService(); var sts = (await serviceTaskService.GetAllAsync()).ToList(); Assert.NotNull(sts); Assert.NotEmpty(sts); Assert.True(10 <= sts.Count()); }
public async void DeleteOne() { int taskid = 1; IServiceTaskService serviceTaskService = new ServiceTaskService(); await serviceTaskService.DeleteAsync(taskid); var sts = (await serviceTaskService.GetAllAsync()).ToList(); foreach (var st in sts) { Assert.NotEqual(1, st.TaskId); } }
public async void SearchByCriticality() { Search search = new Search { MinCriticality = 1 }; IServiceTaskService serviceTaskService = new ServiceTaskService(); var sts = (await serviceTaskService.SearchAsync(search)).ToList(); foreach (var st in sts) { Assert.Equal(1, (int)st.Criticality); } }