Table of Contents

Class StatisticsAssertions

Namespace
MathAssertions.TUnit
Assembly
MathAssertions.TUnit.dll

Fluent Statistics assertions over double arrays. Null arrays are rejected at entry.

public static class StatisticsAssertions
Inheritance
StatisticsAssertions
Inherited Members

Methods

AreAllWithinSigmasOfMean(double[], double)

Asserts every element of the array lies within sigmas standard deviations of the array's own mean.

[GenerateAssertion(ExpectationMessage = "to have every element within {sigmas} sigmas of its own mean", InlineMethodBody = false)]
public static bool AreAllWithinSigmasOfMean(this double[] value, double sigmas)

Parameters

value double[]
sigmas double

Returns

bool

HasMeanApproximately(double[], double, double)

Asserts the sample mean is within tolerance of expected.

[GenerateAssertion(ExpectationMessage = "to have mean approximately {expected} within tolerance {tolerance}", InlineMethodBody = false)]
public static bool HasMeanApproximately(this double[] value, double expected, double tolerance)

Parameters

value double[]
expected double
tolerance double

Returns

bool

HasMedianApproximately(double[], double, double)

Asserts the sample median is within tolerance of expected.

[GenerateAssertion(ExpectationMessage = "to have median approximately {expected} within tolerance {tolerance}", InlineMethodBody = false)]
public static bool HasMedianApproximately(this double[] value, double expected, double tolerance)

Parameters

value double[]
expected double
tolerance double

Returns

bool

HasPercentileApproximately(double[], double, double, double)

Asserts the percentile-percentile value of the sample is within tolerance of expected.

[GenerateAssertion(ExpectationMessage = "to have {percentile}-percentile approximately {expected} within tolerance {tolerance}", InlineMethodBody = false)]
public static bool HasPercentileApproximately(this double[] value, double percentile, double expected, double tolerance)

Parameters

value double[]
percentile double
expected double
tolerance double

Returns

bool

HasStdDevApproximately(double[], double, double)

Asserts the sample standard deviation is within tolerance of expected.

[GenerateAssertion(ExpectationMessage = "to have standard deviation approximately {expected} within tolerance {tolerance}", InlineMethodBody = false)]
public static bool HasStdDevApproximately(this double[] value, double expected, double tolerance)

Parameters

value double[]
expected double
tolerance double

Returns

bool

HasSumApproximately(double[], double, double)

Asserts the sample sum is within tolerance of expected.

[GenerateAssertion(ExpectationMessage = "to have sum approximately {expected} within tolerance {tolerance}", InlineMethodBody = false)]
public static bool HasSumApproximately(this double[] value, double expected, double tolerance)

Parameters

value double[]
expected double
tolerance double

Returns

bool

HasVarianceApproximately(double[], double, double)

Asserts the unbiased sample variance is within tolerance of expected.

[GenerateAssertion(ExpectationMessage = "to have variance approximately {expected} within tolerance {tolerance}", InlineMethodBody = false)]
public static bool HasVarianceApproximately(this double[] value, double expected, double tolerance)

Parameters

value double[]
expected double
tolerance double

Returns

bool

IsWithinSigmasOfMean(double, double[], double)

Asserts value lies within sigmas standard deviations of sample's mean.

[GenerateAssertion(ExpectationMessage = "to lie within {sigmas} sigmas of the sample mean", InlineMethodBody = false)]
public static bool IsWithinSigmasOfMean(this double value, double[] sample, double sigmas)

Parameters

value double
sample double[]
sigmas double

Returns

bool