public async Task FindAllTest() { var timeData = (await TimeDataDao.FindAllAsync()).ToList(); Assert.AreEqual(10, timeData.Count()); Assert.AreEqual(DateTime.Today.Millisecond, timeData.First().Time); }
public async Task DeleteTest() { var timeData = (await TimeDataDao.FindAllAsync()).First(); await TimeDataDao.DeleteAsync(timeData.SkierId, timeData.RaceId, timeData.SensorId); Assert.IsNull(await TimeDataDao.FindByIdAsync(timeData.SkierId, timeData.RaceId, timeData.SensorId)); }
public async Task GetAverageTimeForSensorTest() { var race = (await RaceDao.FindAllAsync()).First(); var timeDatas = await TimeDataDao.FindAllAsync(); var tasks = timeDatas.Where(t => t.RaceId == race.Id && t.Sensor.SensorNumber == 1).Select( async t => { t.Time = 1500; await TimeDataDao.UpdateAsync(t); }); await Task.WhenAll(tasks); Assert.AreEqual(1500, await TimeDataDao.GetAverageTimeForSensor(race.Id, 1)); }
public async Task DeleteAllTest() { await TimeDataDao.DeleteAllAsync(); Assert.AreEqual(0, (await TimeDataDao.FindAllAsync()).Count()); }