Exemplo n.º 1
0
 public static void CalculateDuration(SectorTime time)
 {
     if (time._duration < 1)
     {
         //calculate:
         time._duration = CalculateDuration(time.StartTime, time.EndTime);
     }
 }
Exemplo n.º 2
0
 public static void CalculateDuration(SectorTime time)
 {
     if (time._duration < 1)
     {
         //calculate:
         time._duration = CalculateDuration(time.StartTime, time.EndTime);
     }
 }
Exemplo n.º 3
0
 public bool RecordResult(SectorTime result)
 {
     SetSectorTime set = new SetSectorTime();
     set.RaceId = result.RaceId;
     set.SectorId = result.SectorId;
     set.AthleteId = result.AthleteId;
     set.StartTime = result.StartTime;
     set.EndTime = result.EndTime;
     set.Duration = result.Duration;
     set.Execute();
     return true;
 }
Exemplo n.º 4
0
        public void RecordResultTest()
        {
            ResultService target = new ResultService();

            SectorTime result = new SectorTime();
            result.RaceId = 1;
            result.SectorId = Sector.Swim;
            result.AthleteId = new Random().Next();
            result.StartTime = new DateTime(2008, 09, 19, 12, 00, 00);
            result.EndTime = new DateTime(2008, 09, 19, 12, 20, 20);

            target.RecordResult(result);

            //ensure result available:
            string sqlCommand = string.Format(TestSQL.TriathlonResult.SectorTimes.GetDurationFormat, result.RaceId, result.SectorId, result.AthleteId);
            int duration = TestDataHelper.GetScalar<int>(sqlCommand);
            Assert.AreEqual<int>(result.Duration, duration);
        }