示例#1
0
        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);
                }
            }
        }
示例#2
0
        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());
        }
示例#3
0
        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);
            }
        }