Skip to content

Instantly share code, notes, and snippets.

@fedesilva
Created November 13, 2014 00:40
Show Gist options
  • Save fedesilva/14d5a4d9de8ee9f19d95 to your computer and use it in GitHub Desktop.
Save fedesilva/14d5a4d9de8ee9f19d95 to your computer and use it in GitHub Desktop.
los tests
import util.{Solutions, ScalaMeetupSpec}
/** Tests to validate your implementation
*
*/
class FinancialReaderTest extends ScalaMeetupSpec with Solutions {
import FinancialReader._
"Financial" should "for get correct files for a list symbols " in {
findFiles(smallDataSetDir, symbols ) should have size 1
findFiles(dataSetDir, symbols ) should have size 2
}
// Debe soportar simbolos no existentes, mezclados con existentes.
it should "accept symbols that exist and symbols that not" in {
findFiles(dataSetDir, badSymbols) should have size 2
}
// Debe soportar que no exista ningun symbol
it should "return an empty file list if no symbol exists" in {
findFiles(dataSetDir, noSymbols) should have size 0
}
// Debe leer solo las lineas relevantes
it should "be able to get correct number of lines for a file" in {
val files = findFiles(smallDataSetDir, symbols )
val lines = readLines(files.head)
lines should have size 8
}
// Debe poder construir un row a partir de una linea
it should "be able to build a row from a line" in {
val l = parseLine(line)
l should have size 7
}
// Debe poder construir un row a partir de una linea rota
it should "be able to build a row from a malformed line" in pendingU()
// Para un sample X debe retornar data correcta.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment