The term Z-test is often used to refer specifically to the one-sample
location test comparing the mean of a set of measurements to a given
constant. Due to the central limit theorem, many test statistics are
approximately normally distributed for large samples. Therefore, many
statistical tests can be performed as approximate Z-tests if the sample
size is large.

This example has been gathered from the Wikipedia's page about
the Z-Test, available from: http://en.wikipedia.org/wiki/Z-test

Suppose there is a text comprehension test being run across
a given demographic region. The mean score of the population
from this entire region are around 100 points, with a standard
deviation of 12 points.

There is a local school, however, whose 55 students attained
an average score in the test of only about 96 points. Would
their scores be surprisingly that low, or could this event
have happened due to chance?

// So we would like to check that a sample of// 55 students with a mean score of 96 points:int sampleSize = 55;
double sampleMean = 96;
// Was expected to have happened by chance in a population with// an hypothesized mean of 100 points and standard deviation of// about 12 points:double standardDeviation = 12;
double hypothesizedMean = 100;
// So we start by creating the test:
ZTest test = new ZTest(sampleMean, standardDeviation, sampleSize,
hypothesizedMean, OneSampleHypothesis.ValueIsSmallerThanHypothesis);
// Now, we can check whether this result would be// unlikely under a standard significance level:bool significant = test.Significant;
// We can also check the test statistic and its P-Valuedouble statistic = test.Statistic;
double pvalue = test.PValue;