public void TestDataLineToDataPoint() { var line = new LeMondCsvDataLine() { Calories = "1", Distance = "2.2", HeartRate = "3", Power = "4", Rpm = "5", Speed = "6.6", Time = "00:00:07", }; lines.Add(line); var reader = new LeMondDataReader(provider); var point = reader.DataPoints.Single(); Assert.AreEqual(point.ElapsedCalories, 1); Assert.AreEqual(point.DistanceKilometers, 2.2); Assert.AreEqual(point.HeartRateBeatsPerMinute, 3); Assert.AreEqual(point.PowerWatts, 4); Assert.AreEqual(point.CadenceRotationsPerMinute, 5); Assert.AreEqual(point.SpeedKilometersPerHour, 6.6); Assert.AreEqual(point.ElapsedTime, new TimeSpan(0, 0, 7)); }
public static TcxDataFactory CreateDefault() { Func <SourcedStream, ITcxData> lemond = (r) => { var provider = LeMondCsvDataProvider.Create(r); var reader = new LeMondDataReader(provider); return(new LeMondTcxData(reader)); }; Func <SourcedStream, ITcxData> computrainer3DP = (r) => { var provider = new CompuTrainer3DPFileProvider(r); return(new CompuTrainerTcxData(provider)); }; Func <SourcedStream, ITcxData> computrainerTXT = (r) => { var provider = new CompuTrainerTXTFileProvider(r); return(new CompuTrainerTcxData(provider)); }; return(new TcxDataFactory(lemond, computrainer3DP, computrainerTXT)); }
public static TcxDataFactory CreateDefault() { Func<SourcedStream, ITcxData> lemond = (r) => { var provider = LeMondCsvDataProvider.Create(r); var reader = new LeMondDataReader(provider); return new LeMondTcxData(reader); }; Func<SourcedStream, ITcxData> computrainer3DP = (r) => { var provider = new CompuTrainer3DPFileProvider(r); return new CompuTrainerTcxData(provider); }; Func<SourcedStream, ITcxData> computrainerTXT = (r) => { var provider = new CompuTrainerTXTFileProvider(r); return new CompuTrainerTcxData(provider); }; return new TcxDataFactory(lemond, computrainer3DP, computrainerTXT); }
public LeMondTcxData(LeMondDataReader reader) { this.reader = reader; }
public void TestCtor() { LeMondDataReader reader = new LeMondDataReader(provider); Assert.AreEqual(new DateTime(2012, 1, 2, 16, 31, 0), reader.StartTime, "start time was not read correctly"); }