public void GetValueByTime_EmptyHarmonics_ReturnZeroByAnyTime(double t) { // Assert var harmonicSum = new HarmonicsSum(); // Act double result = harmonicSum.GetValueByTime(t); // Arrange Assert.True(DoubleUtils.EqualsDoubles(0, result)); }
public List <Point> GetPoints(double start, int count, double step) { var result = new List <Point>(); for (int i = 0; i < count; i++) { double t = start + step * i; double y = _harmonicsSum.GetValueByTime(t); result.Add(new Point(t, y)); } return(result); }
public void GetValueByTime_DifferentHarmonics_ReturnedValueEqualsExpected(double t, double expected) { // Assert var harmonicSum = new HarmonicsSum(); harmonicSum.Harmonics.Add(new Harmonic(2.27, 0.22, 0.2, HarmonicType.Sin)); harmonicSum.Harmonics.Add(new Harmonic(1, 0, 1.14, HarmonicType.Sin)); harmonicSum.Harmonics.Add(new Harmonic(1, 3, 2, HarmonicType.Cos)); // Act double result = harmonicSum.GetValueByTime(t); // Arrange Assert.True(DoubleUtils.EqualsDoubles(expected, result)); }