public void DomainController_AddCyclingTrainings_CreatesCyclingTrainging()
        {
            //CyclingSession cycle2 = new CyclingSession(new DateTime(2020, 4, 18, 18, 00, 00), 40, new TimeSpan(1, 42, 00), null, null, TrainingType.Recuperation, null, BikeType.RacingBike);
            //CyclingSession cycle3 = new CyclingSession(new DateTime(2020, 4, 19, 16, 45, 00), null, new TimeSpan(1, 0, 00), null, 219, TrainingType.Interval, "5x5 min 270", BikeType.IndoorBike);

            DC.AddCyclingTraining(new DateTime(2020, 4, 21, 16, 00, 00), 40, new TimeSpan(1, 20, 00), 30, null, TrainingType.Endurance, null, BikeType.RacingBike);

            DC.GetAllCyclingSessions()[0].When.Should().Be(_cycling.When);
            DC.GetAllCyclingSessions()[0].Distance.Should().Be(_cycling.Distance);
            DC.GetAllCyclingSessions()[0].Time.Should().Be(_cycling.Time);
            DC.GetAllCyclingSessions()[0].AverageSpeed.Should().Be(_cycling.AverageSpeed);
            DC.GetAllCyclingSessions()[0].AverageWatt.Should().Be(_cycling.AverageWatt);
            DC.GetAllCyclingSessions()[0].TrainingType.Should().Be(_cycling.TrainingType);
            DC.GetAllCyclingSessions()[0].Comments.Should().Be(_cycling.Comments);
            DC.GetAllCyclingSessions()[0].BikeType.Should().Be(_cycling.BikeType);
        }
Exemple #2
0
        private void maakNieuweTraining_Click(object sender, RoutedEventArgs e)
        {
            //Nieuwe fiets aanmaken
            //AddCyclingTraining(DateTime when, float? distance, TimeSpan time, float? averageSpeed, int? averageWatt, TrainingType trainingType, string comments, BikeType bikeType)
            DateTime     _when         = (DateTime)WhenCalender.SelectedDate;
            float        _distance     = float.Parse(distance.Text);
            TimeSpan     _time         = TimeSpan.Parse(time.Text);
            float        _averageSpeed = float.Parse(averageSpeed.Text);
            int          _averageWatt  = int.Parse(averageWatt.Text);
            TrainingType _trainingType = (TrainingType)trainingType.SelectedItem;
            string       _comments     = comments.Text;
            BikeType     _bikeType     = (BikeType)bikeType.SelectedItem;

            DC.AddCyclingTraining(_when, _distance, _time, _averageSpeed, _averageWatt, _trainingType, _comments, _bikeType);
            this.Close();
        }