public void RecordDataVaryingTimes() { Recorder r = new Recorder(); r.Attach(this, "TimedSampleProperty"); for (int i = 0; i < 1000; i++) { if (i % 10 == 0) { _time++; } TimedSampleProperty = (double)i; } Assert.AreEqual(1000, r.Count); int j = 0; long tm = 0; foreach (TimeValue tv in r) { if (j % 10 == 0) { tm++; } Assert.AreEqual(j++, tv.Value); Assert.AreEqual(tm, tv.Time); } }
public void RecordDataSameTime() { Recorder r = new Recorder(); r.Attach(this, "SampleProperty"); for (int i = 0; i < 1000; i++) { SampleProperty = (double)i; } Assert.AreEqual(1000, r.Count); int j = 0; foreach (TimeValue tv in r) { Assert.AreEqual(j++, tv.Value); Assert.AreEqual(-1L, tv.Time); } }