Skip to content

Commit

Permalink
Run test code through formatter. Refs exercism#488
Browse files Browse the repository at this point in the history
  • Loading branch information
ricemery committed Jan 1, 2019
1 parent e625b9a commit 63a965f
Showing 1 changed file with 40 additions and 20 deletions.
60 changes: 40 additions & 20 deletions exercises/allergies/src/test/scala/AllergiesTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,101 +4,121 @@ import org.scalatest.{Matchers, FunSuite}
class AllergiesTest extends FunSuite with Matchers {

test("Allergen.Peanuts - no allergies means not allergic") {
Allergies.allergicTo(Allergen.Peanuts, 0) should be (false)
Allergies.allergicTo(Allergen.Peanuts, 0) should be(false)
}

test("Allergen.Cats - no allergies means not allergic") {
pending
Allergies.allergicTo(Allergen.Cats, 0) should be (false)
Allergies.allergicTo(Allergen.Cats, 0) should be(false)
}

test("Allergen.Strawberries - no allergies means not allergic") {
pending
Allergies.allergicTo(Allergen.Strawberries, 0) should be (false)
Allergies.allergicTo(Allergen.Strawberries, 0) should be(false)
}

test("Allergen.Eggs - is allergic to eggs") {
pending
Allergies.allergicTo(Allergen.Eggs, 1) should be (true)
Allergies.allergicTo(Allergen.Eggs, 1) should be(true)
}

test("Allergen.Eggs - allergic to eggs in addition to other stuff") {
pending
Allergies.allergicTo(Allergen.Eggs, 5) should be (true)
Allergies.allergicTo(Allergen.Eggs, 5) should be(true)
}

test("Allergen.Shellfish - allergic to eggs in addition to other stuff") {
pending
Allergies.allergicTo(Allergen.Shellfish, 5) should be (true)
Allergies.allergicTo(Allergen.Shellfish, 5) should be(true)
}

test("Allergen.Strawberries - allergic to eggs in addition to other stuff") {
pending
Allergies.allergicTo(Allergen.Strawberries, 5) should be (false)
Allergies.allergicTo(Allergen.Strawberries, 5) should be(false)
}

test("Allergen.Eggs - allergic to strawberries but not peanuts") {
pending
Allergies.allergicTo(Allergen.Eggs, 9) should be (true)
Allergies.allergicTo(Allergen.Eggs, 9) should be(true)
}

test("Allergen.Peanuts - allergic to strawberries but not peanuts") {
pending
Allergies.allergicTo(Allergen.Peanuts, 9) should be (false)
Allergies.allergicTo(Allergen.Peanuts, 9) should be(false)
}

test("Allergen.Shellfish - allergic to strawberries but not peanuts") {
pending
Allergies.allergicTo(Allergen.Shellfish, 9) should be (false)
Allergies.allergicTo(Allergen.Shellfish, 9) should be(false)
}

test("Allergen.Strawberries - allergic to strawberries but not peanuts") {
pending
Allergies.allergicTo(Allergen.Strawberries, 9) should be (true)
Allergies.allergicTo(Allergen.Strawberries, 9) should be(true)
}

test("no allergies at all") {
pending
Allergies.list(0) should be (List())
Allergies.list(0) should be(List())
}

test("allergic to just eggs") {
pending
Allergies.list(1) should be (List(Allergen.Eggs))
Allergies.list(1) should be(List(Allergen.Eggs))
}

test("allergic to just peanuts") {
pending
Allergies.list(2) should be (List(Allergen.Peanuts))
Allergies.list(2) should be(List(Allergen.Peanuts))
}

test("allergic to just strawberries") {
pending
Allergies.list(8) should be (List(Allergen.Strawberries))
Allergies.list(8) should be(List(Allergen.Strawberries))
}

test("allergic to eggs and peanuts") {
pending
Allergies.list(3) should be (List(Allergen.Eggs, Allergen.Peanuts))
Allergies.list(3) should be(List(Allergen.Eggs, Allergen.Peanuts))
}

test("allergic to more than eggs but not peanuts") {
pending
Allergies.list(5) should be (List(Allergen.Eggs, Allergen.Shellfish))
Allergies.list(5) should be(List(Allergen.Eggs, Allergen.Shellfish))
}

test("allergic to lots of stuff") {
pending
Allergies.list(248) should be (List(Allergen.Strawberries, Allergen.Tomatoes, Allergen.Chocolate, Allergen.Pollen, Allergen.Cats))
Allergies.list(248) should be(
List(Allergen.Strawberries,
Allergen.Tomatoes,
Allergen.Chocolate,
Allergen.Pollen,
Allergen.Cats))
}

test("allergic to everything") {
pending
Allergies.list(255) should be (List(Allergen.Eggs, Allergen.Peanuts, Allergen.Shellfish, Allergen.Strawberries, Allergen.Tomatoes, Allergen.Chocolate, Allergen.Pollen, Allergen.Cats))
Allergies.list(255) should be(
List(Allergen.Eggs,
Allergen.Peanuts,
Allergen.Shellfish,
Allergen.Strawberries,
Allergen.Tomatoes,
Allergen.Chocolate,
Allergen.Pollen,
Allergen.Cats))
}

test("ignore non allergen score parts") {
pending
Allergies.list(509) should be (List(Allergen.Eggs, Allergen.Shellfish, Allergen.Strawberries, Allergen.Tomatoes, Allergen.Chocolate, Allergen.Pollen, Allergen.Cats))
Allergies.list(509) should be(
List(Allergen.Eggs,
Allergen.Shellfish,
Allergen.Strawberries,
Allergen.Tomatoes,
Allergen.Chocolate,
Allergen.Pollen,
Allergen.Cats))
}
}

0 comments on commit 63a965f

Please sign in to comment.