public void TestAverageOfDecibelValues() { var decibelArray1 = new[] { 96.0, 100.0, 90.0, 97.0 }; var decibelArray2 = new[] { -96.0, -100.0, -90.0, -97.0 }; // run this once to generate expected test data // uncomment this to update the binary data. Should be rarely needed var average = SpectrogramTools.AverageAnArrayOfDecibelValues(decibelArray1); Assert.AreEqual(96.98816759, average, AllowedDelta); average = SpectrogramTools.AverageAnArrayOfDecibelValues(decibelArray2); Assert.AreEqual(-94.11528038, average, AllowedDelta); }