est-il possible d'imbriquer suivant le code de test caractéristiquescaractéristiques Scala: nid dans les déclarations
"ClassX" should {
"throw an IllegalArgumentException if n < 0" in {
ClassX(-1) must throwA[IllegalArgumentException]
}
"throw an IllegalArgumentException if n > 50" in {
ClassX(51) must throwA[IllegalArgumentException]
}
"throw an IllegalArgumentException if n == 35" in {
ClassX(35) must throwA[IllegalArgumentException]
}
}
dans un autre en déclaration comme:
"ClassX" should {
"throw an IllegalArgumentException if" in {
"n < 0" in {
ClassX(-1) must throwA[IllegalArgumentException]
}
"n > 50" in {
ClassX(51) must throwA[IllegalArgumentException]
}
"n == 35" in {
ClassX(35) must throwA[IllegalArgumentException]
}
}
}
Parce qu'il est plus facile à lire et à écrire
Ok. Merci beaucoup. Mon code ci-dessus fonctionne très bien. J'ai eu une autre erreur dans mon code, donc le test a échoué. – sschaef