Exemplo n.º 1
0
        public async Task FindAllTest()
        {
            var timeData = (await TimeDataDao.FindAllAsync()).ToList();

            Assert.AreEqual(10, timeData.Count());
            Assert.AreEqual(DateTime.Today.Millisecond, timeData.First().Time);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        public async Task DeleteAllTest()
        {
            await TimeDataDao.DeleteAllAsync();

            Assert.AreEqual(0, (await TimeDataDao.FindAllAsync()).Count());
        }