public AddCheckpointOrderDB ( int checkpointId, int startingNumber ) : int | ||
checkpointId | int | |
startingNumber | int | |
return | int |
public void It_Should_Be_Possible_To_Connect_An_Athlete_To_A_Startnumber() { Given("we have an athlete and a startnumber registrert", () => { athlete.ConnectToRace(race.RaceId); timer = CreateNewTimerModelWithCheckpoints(race); checkpointOrder = new CheckpointOrderModel(); checkpointOrder.AddCheckpointOrderDB(timer.CurrentCheckpointId, 1); timer.Start(); timer.AddRuntime(400, timer.GetFirstCheckpointId()); intermediate = new RaceIntermediateModel(timer.CurrentCheckpointId, checkpointOrder.ID, timer.CheckpointRuntimes[timer.CurrentCheckpointId].First().Key); intermediate.Save(); }); When("we want to connect athletes to startnumbers", () => { RaceIntermediateModel.MergeAthletes(race.RaceId); }); Then("athletes should be connected to raceintermediate", () => { RaceIntermediateModel.GetRaceintermediatesForRace(race.RaceId).First().AthleteId.ShouldNotBeNull(); }); }
/// <summary> /// Creates the new timer model with checkpoints. /// </summary> /// <returns></returns> private void Setup() { eventModel = new EventModel("Testevent", DateTime.Today); eventModel.Save(); race = new RaceModel("Testrace", DateTime.Today); race.EventId = eventModel.EventId; race.Save(); timer = new TimerModel(); timer.RaceID = race.RaceId; checkpoint = new CheckpointModel("Checkpoint1", timer, race, 1); checkpoint.SaveToDb(); checkpointorder = new CheckpointOrderModel(); checkpointorder.AddCheckpointOrderDB(checkpoint.Id, 12); checkpointorder.StartingNumber = 12; timer.CurrentCheckpointId = timer.GetFirstCheckpointId(); timer.CheckpointRuntimes.Add(timer.CurrentCheckpointId, new Dictionary<int, int>()); timer.SaveToDb(); timestart = new TimeStartnumberModel(timer); timestart.CheckpointOrder = checkpointorder; //timestart.AddStartnumber(checkpoint.Id, checkpointorder.StartingNumber, 500); }