Example #1
0
 public ActionResult Create(BancoDto dto)
 {
     try
     {
         _query = new DQuery(_unitOfWork);
         _query.Insertar(dto);
         _unitOfWork = _query.GetUnitOfWork();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return(RedirectToAction("Index"));
 }
        public void TestInsertarBancoAreEqual()
        {
            var compare = false;
            var dto     = new BancoDto();

            dto.Id            = 10;
            dto.Nombre        = "Continental";
            dto.Direccion     = "Torre Principal";
            dto.FechaRegistro = DateTime.Now;
            _query.Insertar(dto);
            var lista = _query.Listar(new BancoDto());

            if (lista[2].Id == dto.Id &&
                lista[2].Nombre == dto.Nombre &&
                lista[2].Direccion == dto.Direccion)
            {
                compare = true;
            }
            Assert.AreEqual(compare, true);
        }