public void ModifyTextoComentarioTest() { UserProfile userProfile = CreateTestUserProfile(); ComentarioEtiquetaBlock comentarioTest = CreateTestComentario(userProfile.usrId); opinadorService.ModifyComentarioAndEtiqueta(comentarioTest.Comentario.comentarioId, "Familia", null); Assert.AreEqual(comentarioDao.Find(comentarioTest.Comentario.comentarioId).texto, "Familia"); opinadorService.ModifyComentarioAndEtiqueta(comentarioTest.Comentario.comentarioId, "Campo", null); Assert.AreEqual(comentarioDao.Find(comentarioTest.Comentario.comentarioId).texto, "Campo"); }
protected void BtnAccept_Click(object sender, EventArgs e) { /* Get data. */ String comment = this.txtNewComment.Text; long idComment = long.Parse(Request.Params.Get("id")); UserSession userSession = (UserSession)Context.Session["userSession"]; long idUsuario = userSession.UserProfileId; /* Do action. */ IUnityContainer container = (IUnityContainer)HttpContext.Current.Application["unityContainer"]; IOpinadorService opinadorService = container.Resolve <IOpinadorService>(); opinadorService.ModifyComentarioAndEtiqueta(idComment, comment, null); Response.Redirect(Response.ApplyAppPathModifier("./Mainpage.aspx")); }