You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ArticleSpec.scala 726B

12345678910111213141516171819202122232425262728
  1. package de.codingchallenge.models
  2. import de.codingchallenge.BaseSpec
  3. import de.codingchallenge.csv.CsvOps._
  4. import de.codingchallenge.fixtures.ArticleFixture
  5. class ArticleSpec extends BaseSpec {
  6. "The Article" must {
  7. "parse fields as expecte" in {
  8. val sampleCsv = "A-UhnpVjCE|P-NhImbQSB|CKVTFO LCCOR TFIAZTP|lxqjlivf dppzKc|79.54|0"
  9. sampleCsv.csvToOptOf[Article].get mustBe Article(
  10. "A-UhnpVjCE",
  11. "P-NhImbQSB",
  12. "CKVTFO LCCOR TFIAZTP",
  13. Some("lxqjlivf dppzKc"),
  14. 79.54f,
  15. 0)
  16. }
  17. "parse a sample data" in new ArticleFixture {
  18. sampleData
  19. .foreach(row => {
  20. row.csvToOptOf[Article].get mustBe a[Article]
  21. }
  22. )
  23. }
  24. }
  25. }