コード例 #1
0
        public static async Task <Run> InsertRun(ConnectionFactory connectionFactory,
                                                 Skier skier = null, Race race = null)
        {
            IRunDao runDao = new RunDao(connectionFactory);

            Location location = await LocationDaoTests.InsertLocation(connectionFactory);

            skier ??= await SkierDaoTests.InsertSkier(connectionFactory, location.Country);

            race ??= await RaceDaoTests.InsertRace(connectionFactory, location);

            Run run = new Run
            {
                Skier         = skier,
                Race          = race,
                RunNumber     = 1,
                StartPosition = 1,
                Status        = RunStatus.Completed,
                TotalTime     = 82.1,
            };

            run.Id = await runDao.Insert(run);

            return(run);
        }
コード例 #2
0
        public static async Task <Race> InsertRace(ConnectionFactory connectionFactory, Location location = null)
        {
            IRaceDao raceDao = new RaceDao(connectionFactory);

            location ??= await LocationDaoTests.InsertLocation(connectionFactory);

            Race race = new Race
            {
                Name            = "Kitzbühel Slalom",
                Date            = DateTime.Today,
                Location        = location,
                Gender          = Gender.Female,
                RaceType        = RaceType.Slalom,
                Description     = null,
                Website         = null,
                NumberOfSensors = 5,
                Status          = RaceStatus.Ready
            };

            race.Id = await raceDao.Insert(race);

            return(race);
        }