public void findOrDefaultTest()
 {
     using (IConnection Conexion = new Connection())
     {
         IDao<ClassificacaoEntity> dao = new ClassificacaoCarrierDAO(Conexion);
         ClassificacaoEntity entity = dao.FindOrDefault(xid);
         string esperado = xid;
         string result = entity.id_classificacao.ToString();
         Assert.AreEqual(esperado, result);
     }
 }
 public void deleteTest()
 {
     using (IConnection Conexion = new Connection())
     {
         IDao<ClassificacaoEntity> dao = new ClassificacaoCarrierDAO(Conexion);
         ClassificacaoEntity entity = dao.FindOrDefault(xid);
         bool esperado = true;
         bool result = dao.Delete(entity);
         Assert.AreEqual(esperado, result);
     }
 }
 protected void btnAdicionar_Click(object sender, EventArgs e)
 {
     string xid = Request.QueryString["ID"];
     using (IConnection Conexion = new Connection())
     {
         IDao<ClassificacaoEntity> dao = new ClassificacaoCarrierDAO(Conexion);
         ClassificacaoEntity entity = dao.FindOrDefault(xid);
         entity.tipo = ddlTipo.SelectedValue;
         entity.descricao = txtDescricao.Text;
         dao.Update(entity);
         Response.Redirect("~/Administrativa/ConsultarClassificacao.aspx");
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string xid = Request.QueryString["ID"];
         using (IConnection Conexion = new Connection())
         {
             IDao<ClassificacaoEntity> dao = new ClassificacaoCarrierDAO(Conexion);
             ClassificacaoEntity entity = dao.FindOrDefault(xid);
             ddlTipo.SelectedValue = entity.tipo;
             txtDescricao.Text = entity.descricao;
         }
     }
 }