Esempio n. 1
0
 /// <summary>
 /// Initialises a new instance of the <see cref="DriverModel"/> class and specifies the
 /// driver's Id.
 /// </summary>
 /// <param name="id">The driver's Id.</param>
 public DriverModel(int id)
 {
     Id = id;
     LapTimes = new LapTimesModel();
     PitTimes = new PostedTimeCollectionModel();
     QuallyTimes = new QuallyTimesModel();
     Status = DriverStatus.InPits;
     Builder = new DriverModelBuilder(this);
 }
Esempio n. 2
0
        public void changes_to_the_qually_time_properties_raise_the_property_changed_event()
        {
            var model = new QuallyTimesModel();
            var observer = model.CreateObserver();

            model.SetTime(1, TimeSpan.FromSeconds(1d));
            Assert.True(observer.HasChanged(x => x.Q1));

            model.SetTime(2, TimeSpan.FromSeconds(2d));
            Assert.True(observer.HasChanged(x => x.Q2));

            model.SetTime(3, TimeSpan.FromSeconds(3d));
            Assert.True(observer.HasChanged(x => x.Q3));
        }
Esempio n. 3
0
        public void can_get_a_qually_time()
        {
            TimeSpan time;
            var model = new QuallyTimesModel();

            time = TimeSpan.FromSeconds(1d);
            model.SetTime(1, time);
            Assert.Equal(time, model.GetTime(1));

            time = TimeSpan.FromSeconds(2d);
            model.SetTime(2, time);
            Assert.Equal(time, model.GetTime(2));

            time = TimeSpan.FromSeconds(3d);
            model.SetTime(3, time);
            Assert.Equal(time, model.GetTime(3));
        }
Esempio n. 4
0
        public void can_set_a_qually_time()
        {
            TimeSpan time;
            var model = new QuallyTimesModel();

            time = TimeSpan.FromSeconds(1d);
            model.SetTime(1, time);
            Assert.Equal(time, model.Q1);
            model.SetTime(1, null);
            Assert.Null(model.Q1);

            time = TimeSpan.FromSeconds(2d);
            model.SetTime(2, time);
            Assert.Equal(time, model.Q2);
            model.SetTime(2, null);
            Assert.Null(model.Q2);

            time = TimeSpan.FromSeconds(3d);
            model.SetTime(3, time);
            Assert.Equal(time, model.Q3);
            model.SetTime(3, null);
            Assert.Null(model.Q3);
        }
Esempio n. 5
0
        public void can_create()
        {
            var model = new QuallyTimesModel();

            Assert.Empty(model);
        }
 public static void Empty(this Assertions assert, QuallyTimesModel model)
 {
     assert.Null(model.Q1);
     assert.Null(model.Q2);
     assert.Null(model.Q3);
 }