public void PruebaToString(string nombre, int prioridad, string fechaInicio, string fechaFin) { StringBuilder textoEsperado = new StringBuilder(); textoEsperado.Append(nombre); textoEsperado.Append(" [Prioridad: "); if (prioridad == Tarea.PRIORIDAD_ALTA) { textoEsperado.Append("Alta"); } else if (prioridad == Tarea.PRIORIDAD_BAJA) { textoEsperado.Append("Baja"); } else { textoEsperado.Append("Media"); } textoEsperado.Append(", DuraciĆ³n pendiente: "); textoEsperado.Append(10); textoEsperado.Append(", Inicio: "); textoEsperado.Append(DateTime.Parse(fechaInicio).Date.ToShortDateString()); textoEsperado.Append(", Fin: "); textoEsperado.Append(DateTime.Parse(fechaFin).Date.ToShortDateString()); textoEsperado.Append("]"); Tarea tarea = new TareaSimple(new ContextoGestorProyectos()) { Nombre = nombre, Prioridad = prioridad, FechaInicio = DateTime.Parse(fechaInicio).Date, FechaFinalizacion = DateTime.Parse(fechaFin).Date, DuracionPendiente = 10 }; Assert.Equal(textoEsperado.ToString(), tarea.ToString()); }