Ejemplo n.º 1
0
        public void Add_should_run_add_new_task_command()
        {
            var command = new AddNewTaskCommand();

            taskController.Add(command);

            commandBus.Verify(cb => cb.Run(command));
        }
Ejemplo n.º 2
0
        public void Add_OnGet_Success_Test()
        {
            _addTaskMapper.Expect(mapper => mapper.BuildViewModel());
            var result = _taskController.Add() as ViewResult;

            Assert.AreEqual("Add", result.ViewName);
        }
Ejemplo n.º 3
0
        public void Add()
        {
            // Arrange
            var data = new Task()
            {
                Title           = "TaskDummy",
                Description     = "TaskDescription",
                ExpireDate      = DateTime.Now,
                PercentComplete = "0",
                Status          = "Pending"
            };
            var results = controller.Add(data);

            Assert.AreEqual("Successfully add data", results);
        }
Ejemplo n.º 4
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(txtTask.Text))
     {
         MessageBox.Show("Görev boş geçilemez.");
         return;
     }
     if (_taskID != 0)
     {
         task.Description = txtTask.Text;
         bool result = _taskController.Update(task);
         if (result)
         {
             MessageBox.Show("Guncelleme Basarılı");
         }
         else
         {
             MessageBox.Show("Bır hata olustu");
         }
     }
     else
     {
         currentTask             = new Tasks();
         currentTask.StatusID    = (int)Status.ToDo;
         currentTask.Description = txtTask.Text;
         currentTask.BoardID     = _boardID;
         currentTask.IsActive    = true;
         bool result = _taskController.Add(currentTask);
         if (result)
         {
             int taskID = _taskController.GetTaskByLastAdded();
             MessageBox.Show("Görev oluşturuldu.");
         }
         else
         {
             MessageBox.Show("Hata");
         }
         this.Close();
     }
 }
Ejemplo n.º 5
0
 private void tsbAddTask_Click(object sender, EventArgs e)
 {
     task = TaskController.Add(data);
     tsbSaveTask.Visible = true;
     tsbDelete.Visible   = true;
 }