public void Test0060() { #region テストデータ準備 var testEntityExist = TestUtilLib.GenarateRandomTodoTask(); var testEntityNotExist = TestUtilLib.GenarateRandomTodoTask(); using (var context = new EfDbContext()) { context.Add(testEntityExist); context.SaveChanges(); } using (var context = new EfDbContext()) Assert.AreEqual(1, context.TodoTasks.Count()); #endregion Assert.AreEqual(1, DalTodoTask.Delete(testEntityExist.TodoTaskId)); Assert.AreEqual(0, DalTodoTask.Delete(testEntityNotExist.TodoTaskId)); using (var context = new EfDbContext()) Assert.AreEqual(0, context.TodoTasks.Count()); }
/// <summary> /// ボタン〔削除〕押下処理 /// </summary> private void Delete_Click() { DalTodoTask.Delete(this.TodoTaskId.Value); this.RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel)); }