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));
        }
示例#2
0
        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));
        }
示例#3
0
        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);
        }
示例#4
0
 public LeMondTcxData(LeMondDataReader reader)
 {
     this.reader = reader;
 }
示例#5
0
 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");
 }