コード例 #1
0
 public void TestStartup()
 {
     eventModel = new EventModel("Test", DateTime.Today);
     eventModel.Save();
     race = new RaceModel("testrace", DateTime.Today);
     race.EventId = eventModel.EventId;
     race.Save();
     athlete = new AthleteModel("Test", "Testesen");
 }
コード例 #2
0
 public void TestSetup()
 {
     eventModel = new EventModel("TestEvent", DateTime.Today);
     eventModel.Save();
     race = new RaceModel("TestRace", DateTime.Today);
     race.EventId = eventModel.EventId;
     race.Save();
     timer = new TimerModel();
     timer.SaveToDb();
 }
コード例 #3
0
ファイル: RaceModelTest.cs プロジェクト: heinek/ITimeU
 public void TestSetup()
 {
     ctxDBTest = new Entities();
     newEvent = new EventModel("TestEvent", DateTime.Today);
     newEvent.Save();
     newRace = new RaceModel("RaceModelTestRace", new DateTime(2009, 2, 3));
     newRace.EventId = newEvent.EventId;
     newRace.Save();
     raceDB = new Race();
     raceDB.EventId = newEvent.EventId;
     raceDB.Name = "TestingRaceModel";
     raceDB.Distance = 200;
     raceDB.StartDate = DateTime.Parse("10/03/2020");
     ctxDBTest.Races.AddObject(raceDB);
     ctxDBTest.SaveChanges();
 }
コード例 #4
0
ファイル: RaceIntermediateTest.cs プロジェクト: heinek/ITimeU
 public void TestSetup()
 {
     club = new ClubModel("Test IK");
     eventModel = new EventModel("TestEvent", DateTime.Today);
     eventModel.Save();
     athlete = new AthleteModel("Tester", "Test");
     athlete.StartNumber = 1;
     athlete.Club = club;
     athlete.SaveToDb();
     race = new RaceModel("TestRace", DateTime.Today);
     race.EventId = eventModel.EventId;
     race.Save();
     checkpointOrder = null;
     intermediate = null;
     checkpoint = null;
 }
コード例 #5
0
 /// <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);
 }
コード例 #6
0
ファイル: EventModelTest.cs プロジェクト: heinek/ITimeU
        public void Creating_An_Event_With_An_Invalid_Date_Should_Throw_An_Exception()
        {
            string exmessage = "";
            string expectedmessage = "Ugyldig dato for stevne";
            Given("we want to create a new event");

            When("we create the event", () =>
            {
                newEvent = new EventModel("Testevent", new DateTime(2000, 1, 1));
                try
                {
                    newEvent.Save();
                }
                catch (ArgumentException ex)
                {
                    exmessage = ex.Message;
                }
            });

            Then("the exceptionmessage should be: " + expectedmessage, () =>
            {
                exmessage.ShouldBeSameAs(expectedmessage);
            });
        }
コード例 #7
0
ファイル: TimerModelTest.cs プロジェクト: heinek/ITimeU
 public void TestSetup()
 {
     timer = new TimerModel();
     eventModel = new EventModel("TestEvent", DateTime.Today);
     eventModel.Save();
     race = new RaceModel("SomeRace", new DateTime(2007, 10, 3));
     race.EventId = eventModel.EventId;
     race.Save();
     checkpoint = new CheckpointModel("Checkpoint1", timer, race, 1);
     checkpoint2 = new CheckpointModel("Checkpoint2", timer, race, 2);
     timer.CurrentCheckpointId = timer.GetFirstCheckpointId();
     timer.CheckpointRuntimes.Add(timer.CurrentCheckpointId, new Dictionary<int, int>());
 }
コード例 #8
0
 public void TestSetup()
 {
     timeMerger = new TimeMergerModel();
     timer = new TimerModel();
     eventModel = new EventModel("Testevent", DateTime.Today);
     eventModel.Save();
     race = new RaceModel("SomeRace", new DateTime(2007, 10, 3));
     race.EventId = eventModel.EventId;
     race.Save();
     checkpoint1 = new CheckpointModel("Checkpoint1", timer, race, 1);
     checkpoint2 = new CheckpointModel("Checkpoint2", timer, race, 2);
     timer.RaceID = race.RaceId;
     timer.CurrentCheckpointId = timer.GetFirstCheckpointId();
     timer.CheckpointRuntimes.Add(timer.CurrentCheckpointId, new Dictionary<int, int>());
     checkpointOrderModel = new CheckpointOrderModel();
     timestartnumberModel = new TimeStartnumberModel(timer);
     timestartnumberModel.ChangeCheckpoint(timer.GetFirstCheckpointId());
     timestartnumberModel.CheckpointOrder = checkpointOrderModel;
 }