public void Normal500() { var data = ReadPoints(); var sample = new AverageSampling(); var rs = sample.Down(data, 500); Assert.NotNull(rs); Assert.Equal(500, rs.Length); //var k = 0; //using var csv2 = new CsvFile("Algorithms/rs.csv"); //while (true) //{ // var line = csv2.ReadLine(); // if (line == null) break; // Assert.Equal(line[0].ToInt(), rs[k].Time); // Assert.True(Math.Abs(line[1].ToDouble() - rs[k].Value) < 0.0001); // k++; //} WritePoints(sample, rs, sample.AlignMode); }
public void AlignLeftTest() { var data = ReadPoints(); var sample = new AverageSampling { AlignMode = AlignModes.Left }; var rs = sample.Down(data, 100); Assert.NotNull(rs); Assert.Equal(100, rs.Length); WritePoints(sample, rs, sample.AlignMode); }
public void Fill500() { var data = ReadPoints("source2.csv"); var sample = new AverageSampling { AlignMode = AlignModes.Left }; var rs = sample.Process(data, 60, 5); Assert.NotNull(rs); Assert.Equal(126, rs.Length); //Assert.Equal(5, rs[0].Time); //Assert.Equal(65, rs[1].Time); //Assert.Equal(125, rs[2].Time); WritePoints(sample, rs, sample.AlignMode, "avgfill"); }