public void test_StandardDeviation_throws_MathError_with_0_items_list() { /*Zero items in list should return 0 standard deviation. List is cleared and after * assertion it is restored.*/ testList.Clear(); Assert.Throws <MathError>(() => Variance.StandardDeviation(testList)); testList.Add(2.2); testList.Add(3.5); testList.Add(3); testList.Add(14); }
public void test_StandardDeviation_throws_MathError_with_null_list() { Assert.Throws <MathError>(() => Variance.StandardDeviation(null)); }
public void test_StandardDeviation_calculates_correct_result() { /*Test result for testList calculated with R = 5.575766. Test rounds it up to 4 decimals*/ Assert.AreEqual(Math.Round(5.575766, 4), Math.Round(Variance.StandardDeviation(testList), 4)); }