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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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
Returns
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)