kotest-assertions-core / io.kotest.matchers.stats / kotlin.collections.Collection / shouldNotHaveMean

shouldNotHaveMean

fun <T : Number> Collection<T>.shouldNotHaveMean(value: BigDecimal, precision: Int = 4): Unit

Asserts that mean of the Collection elements doesn't equal to value with default or specific precision. Default precision equals 4 digits after decimal point.

Opposite of shouldHaveMean

Example:

val collection = listOf(1, 1, 3)
val firstMean   = BigDecimal("2.0")
val secondMean = BigDecimal("1.6666667")

collection.shouldNotHaveMean(firstMean)                // Assertion passes
collection.shouldNotHaveMean(secondMean, 5)           // Assertion passes

collection.shouldNotHaveMean(BigDecimal("1.6667"))    // Assertion fails
collection.shouldNotHaveMean(BigDecimal("1.6667"), 4) // Assertion fails

Parameters

value -

precision -

fun <T : Number> Collection<T>.shouldNotHaveMean(value: Double, precision: Int = 4): Unit

Asserts that mean of the Collection elements doesn't equal to value with default or specific precision. Default precision equals 4 digits after decimal point.

Opposite of shouldHaveMean

Example:

val collection = listOf(1, 1, 3)

collection.shouldNotHaveMean(2.0)          // Assertion passes
collection.shouldNotHaveMean(1.67, 5)      // Assertion passes

collection.shouldNotHaveMean(1.6667)       // Assertion fails
collection.shouldNotHaveMean(1.6667, 4)    // Assertion fails

Parameters

value -

precision -