No implicit view available from AnyVal => org.scalacheck.Prop. [error] property
<p>I have 2 questions</p>

<p>I am trying to learn scalacheck</p>

<p>Question 1)</p>

<p>Here is the test I am writing which is throwing the error. Can you please point to which page from docmentation i should read to understand reason behind this error.</p>

<pre><code>case class Student(name:String, age:Int, mathsScore:Int, scienceScore:Int){
  require(name != null ,"Name cannot be blank")
  require(age &gt; 3 ,"Age should be more than 3")
  require(mathsScore &gt;= 0 , "Score should not be negative")
  require(scienceScore &gt;= 0 ,"Score should not be negative")

  val totalScore = mathsScore + scienceScore
}
</code></pre>

<p>Test is</p>

<pre><code>object CaseStudySpecification extends Properties("Case Study Specification") {

  property("nullName") = forAll { (name: String, age: Int, ms: Int, ss: Int) =&gt;
    if (name == null)
      Prop.throws(classOf[IllegalArgumentException]) {
        val x = Student(name, age, ms, ss)
      }
  }
}
</code></pre>

<p>Error is</p>

<pre><code> No implicit view available from AnyVal =&gt; org.scalacheck.Prop.
[error]   property("nullName") = forAll { (name: String, age: Int, ms: Int, ss: Int) =&gt;
[error]                                 ^
</code></pre>

<p>Question 2)</p>

<p>The official documentation gives one example test class as</p>

<pre><code>  property("stringLength") = Prop.forAll { s: String =&gt;
    val len = s.length
    (s+s).length == len+len
  }
</code></pre>

<p>I also read that it can be written as</p>

<pre><code>  val stringLength = Prop.forAll { s: String =&gt;
    val len = s.length
    (s+s).length == len+len
  }
</code></pre>

<p>How can i run the second form of test code , as when i run sbt test nothing happens for second version.</p>

<p>Both of the above snippets are in</p>

<pre><code>object Ch3 extends Properties("String") {

}
</code></pre>