コード例 #1
0
 public void returns_undefined_for_a_set_of_all_negative_numbers()
 {
     //arrange
     var inputData = new[] { -1.0, -1.0, -2.0, -3.0 };
     //act
     var gainStdDev = inputData.GainStandardDeviation();
     //assert
     Assert.AreEqual(double.NaN, gainStdDev);
 }
コード例 #2
0
 public void returns_undefined_with_single_negative_input()
 {
     //arrange
     var inputData = new[] { -1.0 };
     //act
     var gainStdDev = inputData.GainStandardDeviation();
     //assert
     Assert.AreEqual(double.NaN, gainStdDev);
 }
コード例 #3
0
 public void does_not_use_negative_input_data()
 {
     //arrange
     var inputData = new[] { -1.0, 1.0, -2.0, 2.0 };
     var expectedGainStdDeviation = inputData.Where(x => x >= 0).StandardDeviation();
     //act
     var gainStdDev = inputData.GainStandardDeviation();
     //assert
     Assert.AreEqual(expectedGainStdDeviation, gainStdDev);
 }
コード例 #4
0
 public void handles_zero_in_the_data_input_as_a_positive_number()
 {
     //arrange
     var inputData = new[] { -1.0, 0.0, 1.0, 2.0 };
     var expectedGainStdDeviation = inputData.Where(x => x >= 0).StandardDeviation();
     //act
     var gainStdDev = inputData.GainStandardDeviation();
     //assert
     Assert.AreEqual(expectedGainStdDeviation, gainStdDev);
 }