mtkopone/scct — Issue #16: 100% code coverage reported for not tested code.
Author: danielkorzekwa
Created: 2011-12-27 23:27:18+00:00
State: open

Not tested method firstServeAvgPct() for the code below:
---------------------------------------

package dk.atp.api

import AtpWorldTourApi._

/**
* API interface for atpworldtour.com tennis statistics.
*
*/

object AtpWorldTourApi {

object PointWonFactEnum extends Enumeration {
type PointWonFactEnum = Value
val FIRST_SERVE_POINTS_WON = Value("2")
val SECOND_SERVE_POINTS_WON = Value("3")
val FIRST_SERVE_RETURN_POINTS_WON = Value("6")
val SECOND_SERVE_RETURN_POINTS_WON = Value("7")

override def toString() = PointWonFactEnum.values.mkString("MatchfactEnum [", ", ", "]")
}

object SurfaceEnum extends Enumeration {
type SurfaceEnum = Value
val CLAY = Value(1)
val GRASS = Value(2)
val HARD = Value(3)

override def toString() = SurfaceEnum.values.mkString("SurfaceEnum [", ", ", "]")
}

/**
* @param rank
* @param fullName
* @param pctWon Percentage of first serve won
* @param matches Total number of matches
*
*/
case class FirstServeFact(rank:Int,fullName: String, pctWon: Double, matches: Int)
case class FirstServeFacts(playerFacts: List[FirstServeFact]) {
def firstServeAvgPct() = playerFacts.foldLeft(0d)((sum,fact) => sum + fact.pctWon) / playerFacts.size
}

/**
* @param fullName
* @param pointsWon Number of points won
* @param totalPoints Total number of points
* @param pctWon Percentage of matches won
* @param matches Total number of matches
*/
case class PointWonFact(fullName: String, pointsWon: Int, totalPoints: Int, pctWon: Double, matches: Int)
case class PointWonFacts(playerFacts: List[PointWonFact])

}

import AtpWorldTourApi.PointWonFactEnum._
import AtpWorldTourApi.SurfaceEnum._

trait AtpWorldTourApi {

/**Match facts statistics http://www.atpworldtour.com/Matchfacts/Matchfacts-Landing.aspx*/
def firstServeFacts(surface: SurfaceEnum, year: Int): FirstServeFacts

/**Match facts statistics http://www.atpworldtour.com/Matchfacts/Matchfacts-Landing.aspx*/
def pointWonFacts(pointWonFact: PointWonFactEnum, surface: SurfaceEnum, year: Int): PointWonFacts

}
-------------------------------

pom file:
------------------------------

4.0.0
dk.atp
atpworldtour-api
atpworldtour-api
0.1-SNAPSHOT
2011
https://github.com/danielkorzekwa/atpworldtour-api

2.9.1
4.4

scala-tools.org
Scala-Tools Maven2 Repository
http://scala-tools.org/repo-releases

scala-tools.org
Scala-Tools Maven2 Repository
http://scala-tools.org/repo-releases

src/main/scala
src/test/scala

false
src/main/scala

**/*.scala

false
src/main/resources

**/*.*

false
src/test/scala

**/*.scala

false
src/test/resources

**/*.*

org.scala-tools
maven-scala-plugin

compile
testCompile

org.apache.maven.plugins
maven-eclipse-plugin
2.8

true

ch.epfl.lamp.sdt.core.scalabuilder

ch.epfl.lamp.sdt.core.scalanature

org.eclipse.jdt.launching.JRE_CONTAINER
ch.epfl.lamp.sdt.launching.SCALA_CONTAINER

org.scala-tools
maven-scala-plugin
2.13.1

coverage

scct repository
http://mtkopone.github.com/scct/maven-repo

reaktor
scct_2.9.1
0.1-SNAPSHOT

org.apache.maven.plugins
maven-surefire-plugin
2.6

${project.name}
${project.build.outputDirectory}/coverage.data
${project.build.directory}/coverage-report
${project.build.sourceDirectory}

org.scala-tools
maven-scala-plugin

reaktor
scct_2.9.1
0.1-SNAPSHOT

org.scala-lang
scala-library
${scala.version}

org.jsoup
jsoup
1.6.1

junit
junit
${junit.version}
test

------------------------
From: https://github.com/danielkorzekwa/atpworldtour-api/blob/master/src/main/scala/dk/atp/api/AtpWorldTourApi.scala