Inheritance: WebService, IBugService
Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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());
            }
        }
Ejemplo n.º 3
0
        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();
 }
Ejemplo n.º 5
0
 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");
                }
            }
        }
Ejemplo n.º 7
0
        public frmDetalleBug()
        {
            InitializeComponent();

            bugService          = new BugService();
            bugHistoricoService = new BugHistoricoService();
        }
Ejemplo n.º 8
0
        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());
            }
        }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
        public void BugService_When_CloseBugIsCalledWithAEmptySpaceId_Then_ApplicationExceptionIsThrown()
        {
            var id = " ";

            var service = new BugService(_repository.Object);

            Assert.ThrowsAsync <ApplicationException>(() => service.CloseBug(id));
        }
Ejemplo n.º 11
0
        public frmAsignarBug()
        {
            InitializeComponent();

            oBugService = new BugService();

            GUIHelper.getHelper().llenarCombo(cbo_desa, usuarioService.consultarDesarrolladores(), "nombre", "id_usuario");
        }
Ejemplo n.º 12
0
 public BugServiceTests()
 {
     _bug = new Domain.Entity.Bug {
         Name = "Simple Bug"
     };
     _bugRepository = new Mock <IRepository <Data.Entity.Bug> >();
     _bugService    = new BugService(_bugRepository.Object);
 }
Ejemplo n.º 13
0
        public void BugService_When_OpenBugIsCalledWithABugWithMissingMandatoryData_Then_ApplicationExceptionIsThrown()
        {
            var bug = new Bug();

            var service = new BugService(_repository.Object);

            Assert.ThrowsAsync <ApplicationException>(() => service.OpenBug(bug));
        }
Ejemplo n.º 14
0
        public frmABMBug()
        {
            InitializeComponent();

            oBugService       = new BugService();
            criticidadService = new CriticidadService();
            productoService   = new ProductoService();
            prioridadService  = new PrioridadService();
        }
Ejemplo n.º 15
0
        public void BugService_When_UpdateBugIsCalledWithAEmptySpaceId_Then_ApplicationExceptionIsThrown()
        {
            var bug = new Bug {
                Id = " "
            };

            var service = new BugService(_repository.Object);

            Assert.ThrowsAsync <ApplicationException>(() => service.UpdateBug(bug));
        }
Ejemplo n.º 16
0
        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));
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        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));
        }
Ejemplo n.º 19
0
        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");
        }
Ejemplo n.º 20
0
 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();
 }
Ejemplo n.º 21
0
        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);
        }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
0
        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);
        }
Ejemplo n.º 25
0
        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);
        }
Ejemplo n.º 26
0
        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);
        }
Ejemplo n.º 27
0
        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);
        }
Ejemplo n.º 28
0
        public FrmEditarBug(BugService service)
        {
            this.service = service;

            InitializeComponent();
        }
        public frmABMBug()
        {
            InitializeComponent();

            oBugService = new BugService();
        }
Ejemplo n.º 30
0
 public AppController(AppService appService, BugService bugService)
 {
     _appService = appService;
     _bugService = bugService;
 }