This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package model; | |
| import com.sun.jersey.api.client.Client; | |
| import com.sun.jersey.api.client.ClientResponse; | |
| import com.sun.jersey.api.client.WebResource; | |
| import javax.ws.rs.core.MediaType; | |
| import com.google.gson.Gson; | |
| import com.google.gson.GsonBuilder; | |
| import com.google.gson.*; | |
| import com.google.gson.JsonDeserializationContext; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dos alternativas posibles de encarar los tests: | |
| caso 1 seria un equals: | |
| func TestTamanioContenidoBinarioSinCompresion(t *testing.T) { | |
| var expected float32 = 20 | |
| actual := unContBinarioSinCompresion.tamanio() | |
| if actual != expected { | |
| t.Errorf("El tamanio de un contenido binario sin compresion deberia dar '%f', pero da '%f'", expected, actual) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -encarar el tp como que se le manda siempre el mensaje a contenido, si todos los contenido se comportan igual (los 4) se hace de la forma: | |
| func (unContenido contenido) tieneNombreCorto() bool { | |
| return len(unContenido.nombre) < 200 | |
| } | |
| -si se comportan por ejemplo binario y de texto de la forma A, la carpeta en forma B y un link en forma C se haria: (se que hay cierta repeticion de logica pero es inevitable) | |
| func (unContenido contenido) esLiviano() bool { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time | |
| tipoCont tipoContenido | |
| } | |
| type biblioteca struct { | |
| } | |
| type tipoContenido interface { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type contenido struct { | |
| nombre string | |
| ultimaModificacion time.Time | |
| tipoCont tipoContenido | |
| } | |
| type tipoContenido interface { | |
| sePuedeSubir(biblioteca) bool | |
| entraEnBiblioteca(biblioteca) bool | |
| tieneNombreCorto() bool |
NewerOlder