private void PrepareBugData() { bugServiceWse = ServiceManager.GetService <BugService>(); comboBoxSeverity.Clear(); comboBoxPriority.Clear(); try { severities = bugServiceWse.GetSeverities(); priorities = bugServiceWse.GetPriorities(); } catch (SoapException) { Messenger.ShowIncorrectVersionError(); severities = new SeverityDTO[] {}; priorities = new PriorityDTO[] {}; } foreach (SeverityDTO severity in severities) { comboBoxSeverity.AddItem(severity.Name); } comboBoxSeverity.SelectedIndex = comboBoxSeverity.Items.Count / 2; foreach (PriorityDTO property in priorities) { comboBoxPriority.AddItem(property.Name); } comboBoxPriority.SelectedIndex = comboBoxPriority.Items.Count / 2; }
public override void Create() { BugDTO bug = new BugDTO { Name = this.EntityName, ProjectID = this.ProjectId }; if (!String.IsNullOrEmpty(this.UserStory) || IsUserStoryIdSet) { bug.UserStoryID = this.UserStoryId; } if (IsDescriptionSet) { bug.Description = this.Description; } if (!String.IsNullOrEmpty(this.State)) { bug.EntityStateID = this.StateId; } int taskId = BugService.Create(bug); foreach (TargetProcessUser user in this.UsersToAssign) { BugService.AssignUser(taskId, user.GetId()); } }
public async void BugService_When_UpdateBugIsCalledWithAnIdThatExistsAndUpdateBugCalledOnRepositoryFails_Then_FalseIsReturned() { var newBugData = new Bug { Id = "123", Title = "Updated Title", Description = "Updated description", ClosedOn = DateTime.Now, Status = Status.Closed, AssignedTo = "User", ReportedBy = "User", ReportedOn = DateTime.Now, Severity = Severity.High }; var existingBugData = new Bug { Id = "123", Title = "Existing Title", Description = "Existing description", ClosedOn = DateTime.MinValue, Status = Status.Opened, AssignedTo = "", ReportedBy = "", ReportedOn = DateTime.MinValue, Severity = Severity.Low }; _repository.Setup(_ => _.Find(newBugData.Id)).ReturnsAsync(existingBugData); _repository.Setup(_ => _.Update(existingBugData)).ReturnsAsync(false); var service = new BugService(_repository.Object); var result = await service.UpdateBug(newBugData); Assert.False(result); }
public frmConsultaBugs() { InitializeComponent(); // Inicializamos la grilla de bugs InitializeDataGridView(); bugService = new BugService(); }
public FrmConsultaBugs() { service = new BugService(); InitializeComponent(); llenarCombo(cbo_productos, "Productos", "id_producto", "nombre"); llenarCombo(cboEtiquetas, "Etiquetas", "id", "n_etiqueta"); }
private void btn_aceptar_Click(object sender, EventArgs e) { BugService service = null; List <int> ids = new List <int>(); if (cbo_estados.SelectedIndex == -1 || txt_obs.Text == "") { MessageBox.Show("Debe completar los campos indicados con (*)"); } else { service = new BugService(); foreach (DataGridViewRow row in dgv_bugs.Rows) { ids.Add(Convert.ToInt32(row.Cells["id_bug_col"].Value.ToString())); } if (service.ActualizarEstadoBugs(ids, (int)cbo_estados.SelectedValue, txt_obs.Text)) { MessageBox.Show("Bugs actualizados!", "Aviso"); this.Close(); } else { MessageBox.Show("Ha ocurrido un error al actualizar los bugs!", "ERROR"); } } }
public frmDetalleBug() { InitializeComponent(); bugService = new BugService(); bugHistoricoService = new BugHistoricoService(); }
public override void Update() { BugDTO bug = BugService.GetByID(this.BugId); bug.Name = this.EntityName; bug.ProjectID = this.ProjectId; if (IsDescriptionSet) { bug.Description = this.Description; } if (!String.IsNullOrEmpty(this.UserStory) || IsUserStoryIdSet) { bug.UserStoryID = this.UserStoryId; } if (!String.IsNullOrEmpty(this.State)) { bug.EntityStateID = this.StateId; } BugService.Update(bug); foreach (TargetProcessUser user in this.UsersToAssign) { BugService.AssignUser(bug.BugID.Value, user.GetId()); } }
public async void BugService_When_GetOpenBugsIsCalled_Then_FindAllIsCalledOnRepository() { var service = new BugService(_repository.Object); await service.GetOpenBugs(); _repository.Verify(_ => _.FindAll(x => x.Status != Status.Closed), Times.Once); }
public void BugService_When_CloseBugIsCalledWithAEmptySpaceId_Then_ApplicationExceptionIsThrown() { var id = " "; var service = new BugService(_repository.Object); Assert.ThrowsAsync <ApplicationException>(() => service.CloseBug(id)); }
public frmAsignarBug() { InitializeComponent(); oBugService = new BugService(); GUIHelper.getHelper().llenarCombo(cbo_desa, usuarioService.consultarDesarrolladores(), "nombre", "id_usuario"); }
public BugServiceTests() { _bug = new Domain.Entity.Bug { Name = "Simple Bug" }; _bugRepository = new Mock <IRepository <Data.Entity.Bug> >(); _bugService = new BugService(_bugRepository.Object); }
public void BugService_When_OpenBugIsCalledWithABugWithMissingMandatoryData_Then_ApplicationExceptionIsThrown() { var bug = new Bug(); var service = new BugService(_repository.Object); Assert.ThrowsAsync <ApplicationException>(() => service.OpenBug(bug)); }
public frmABMBug() { InitializeComponent(); oBugService = new BugService(); criticidadService = new CriticidadService(); productoService = new ProductoService(); prioridadService = new PrioridadService(); }
public void BugService_When_UpdateBugIsCalledWithAEmptySpaceId_Then_ApplicationExceptionIsThrown() { var bug = new Bug { Id = " " }; var service = new BugService(_repository.Object); Assert.ThrowsAsync <ApplicationException>(() => service.UpdateBug(bug)); }
public void BugService_When_CloseBugIsCalledWithAnIdThatDoesntExist_Then_ApplicationExceptionIsThrown() { var id = "123"; Bug bug = null; _repository.Setup(_ => _.Find(id)).ReturnsAsync(bug); var service = new BugService(_repository.Object); Assert.ThrowsAsync <ApplicationException>(() => service.CloseBug(id)); }
public async void BugService_When_FindBugIsCalledWithAValidIdButNoBugFound_Then_NullIsReturned() { var id = "123"; Bug bug = null; _repository.Setup(_ => _.Find(id)).ReturnsAsync(bug); var service = new BugService(_repository.Object); var result = await service.FindBug(id); Assert.Null(result); }
public void BugService_When_UpdateBugIsCalledWithAnIdThatDoesntExist_Then_ApplicationExceptionIsThrown() { var bug = new Bug { Id = "123" }; Bug nullBug = null; _repository.Setup(_ => _.Find(bug.Id)).ReturnsAsync(nullBug); var service = new BugService(_repository.Object); Assert.ThrowsAsync <ApplicationException>(() => service.UpdateBug(bug)); }
public frmActualizarBug() { InitializeComponent(); oBugService = new BugService(); GUIHelper.getHelper().llenarCombo(cboPrioridad, prioridadService.consultarPrioridades(), "nombre", "id_prioridad"); GUIHelper.getHelper().llenarCombo(cboCriticidad, criticidadService.consultarCriticidades(), "nombre", "id_criticidad"); GUIHelper.getHelper().llenarCombo(cboProducto, productoService.consultarProductos(), "nombre", "id_producto"); }
public frmConsultaBugs() { InitializeComponent(); // Inicializamos la grilla de bugs InitializeDataGridView(); bugService = new BugService(); criticidadService = new CriticidadService(); estadoService = new EstadoService(); prioridadService = new PrioridadService(); productoService = new ProductoService(); usuarioService = new UsuarioService(); }
public async void BugService_When_OpenBugIsCalledWithABugWithMandatoryDataAndRepositoryReturnsFalse_Then_ReturnsFalse() { var bug = new Bug { Title = "Test Bug", Description = "Test description" }; _repository.Setup(_ => _.Create(bug)).ReturnsAsync(false); var service = new BugService(_repository.Object); var result = await service.OpenBug(bug); Assert.False(result); }
private int FindBugIdByName(string entityName) { string hqlQuery = "from Bug as bug where bug.Name = ?"; BugDTO[] bugs = BugService.Retrieve(hqlQuery, new object[] { entityName }); if (bugs.Length == 0) { throw new BuildException(string.Format("Could not find a bug named: '{0}'.", entityName)); } return(bugs[0].BugID.Value); }
public async void BugService_When_FindBugIsCalledWithAValidId_Then_ABugIsReturned() { var id = "123"; var bug = new Bug { Id = "123", Title = "Bug Title", Description = "Bug Description" }; _repository.Setup(_ => _.Find(id)).ReturnsAsync(bug); var service = new BugService(_repository.Object); var result = await service.FindBug(id); Assert.Same(bug, result); }
public async void BugService_When_OpenBugIsCalledWithABugWithMandatoryData_Then_ReturnsTrue() { var bug = new Bug { Title = "Test Bug", Description = "Test description" }; _repository.Setup(_ => _.Create(bug)).ReturnsAsync(true); var service = new BugService(_repository.Object); var result = await service.OpenBug(bug); Assert.Equal(Status.Opened, bug.Status); Assert.NotEqual(DateTime.MinValue, bug.ReportedOn); Assert.True(result); }
public async void BugService_When_CloseBugIsCalledWithAnIdThatExistsAndUpdateBugIsCalledOnRepositoryButFails_Then_FalseIsReturned() { var id = "123"; var bug = new Bug { Id = "123", Title = "Test Title", Description = "Test description", ClosedOn = DateTime.MinValue, Status = Status.Opened }; _repository.Setup(_ => _.Find(id)).ReturnsAsync(bug); _repository.Setup(_ => _.Update(bug)).ReturnsAsync(false); var service = new BugService(_repository.Object); var result = await service.CloseBug(id); Assert.False(result); }
public async void BugService_When_CloseBugIsCalledWithAnIdThatExistsAndUpdateBugIsCalledOnRepositorySuccessfullyThen_TrueIsReturned() { var id = "123"; var bug = new Bug { Id = "123", Title = "Test Title", Description = "Test description", ClosedOn = DateTime.MinValue, Status = Status.Opened }; _repository.Setup(_ => _.Find(id)).ReturnsAsync(bug); _repository.Setup(_ => _.Update(bug)).ReturnsAsync(true); var service = new BugService(_repository.Object); var result = await service.CloseBug(id); Assert.Equal(Status.Closed, bug.Status); Assert.NotEqual(DateTime.MinValue, bug.ClosedOn); Assert.True(result); }
public async void BugService_When_UpdateBugIsCalledWithAnIdThatExistsAndUpdateBugIsCalledOnRepositorySuccessfullyAndAssignedToIsntChangedThen_TrueIsReturned() { var newBugData = new Bug { Id = "123", Title = "Updated Title", Description = "Updated description", ClosedOn = DateTime.Now, Status = Status.Closed, AssignedTo = "User", ReportedBy = "User", ReportedOn = DateTime.Now, Severity = Severity.High }; var existingBugData = new Bug { Id = "123", Title = "Existing Title", Description = "Existing description", ClosedOn = DateTime.MinValue, Status = Status.Opened, AssignedTo = "User", ReportedBy = "", ReportedOn = DateTime.MinValue, Severity = Severity.Low }; _repository.Setup(_ => _.Find(newBugData.Id)).ReturnsAsync(existingBugData); _repository.Setup(_ => _.Update(existingBugData)).ReturnsAsync(true); var service = new BugService(_repository.Object); var result = await service.UpdateBug(newBugData); Assert.Equal(newBugData.Id, existingBugData.Id); Assert.Equal(newBugData.Title, existingBugData.Title); Assert.Equal(newBugData.Description, existingBugData.Description); Assert.Equal(newBugData.ClosedOn, existingBugData.ClosedOn); Assert.Equal(newBugData.Status, existingBugData.Status); Assert.Equal(newBugData.AssignedTo, existingBugData.AssignedTo); Assert.Equal(newBugData.ReportedBy, existingBugData.ReportedBy); Assert.Equal(newBugData.ReportedOn, existingBugData.ReportedOn); Assert.Equal(newBugData.Severity, existingBugData.Severity); Assert.True(result); }
public FrmEditarBug(BugService service) { this.service = service; InitializeComponent(); }
public frmABMBug() { InitializeComponent(); oBugService = new BugService(); }
public AppController(AppService appService, BugService bugService) { _appService = appService; _bugService = bugService; }