예제 #1
0
        public void CargarListaDondeHuboPresupuestosTest()
        {
            Repositorio        Repositorio      = new Repositorio();
            ManagerPresupuesto Manager          = new ManagerPresupuesto(Repositorio);
            Presupuesto        presupuestoNuevo = new Presupuesto();

            presupuestoNuevo.Año = 2020;
            presupuestoNuevo.Mes = "March";
            Repositorio.AgregarPresupuesto(presupuestoNuevo);
            Manager.CargarCategoriasPresupuesto(presupuestoNuevo);
            List <string> Lista = Manager.CargarListaDondeHuboPresupuestos();

            Assert.AreEqual(1, Lista.Count);
        }
 private void ReportePresupuesto_Load(object sender, EventArgs e)
 {
     try
     {
         ManagerPresupuesto Manager = new ManagerPresupuesto(Repo);
         comboBox1.DataSource = Manager.CargarListaDondeHuboPresupuestos();
     }
     catch (System.Data.Entity.Core.EntityException)
     {
         this.Enabled = false;
         MessageBox.Show("Error: La base de datos no se encuentra disponible");
     }
     catch (System.Data.SqlClient.SqlException)
     {
         this.Enabled = false;
         MessageBox.Show("Error: La base de datos no se encuentra disponible");
     }
 }