public void DomainController_AddRunningTrainings_CreatesRunningTrainging()
        {
            //DC.AddRunningTraining(new DateTime(2020, 4, 19, 12, 30, 00), 5000, new TimeSpan(0, 25, 48), null, TrainingType.Endurance, null);
            //DC.AddRunningTraining(new DateTime(2020, 3, 17, 11, 0, 00), 5000, new TimeSpan(0, 28, 10), null, TrainingType.Interval, "3x700m");
            //DC.AddRunningTraining(new DateTime(2020, 3, 17, 11, 0, 00), 8000, new TimeSpan(0, 42, 10), null, TrainingType.Endurance, null);

            DC.AddRunningTraining(new DateTime(2020, 4, 17, 12, 30, 00), 5000, new TimeSpan(0, 27, 17), null, TrainingType.Endurance, null);

            DC.GetAllRunningSessions()[0].When.Should().Be(_running.When);
            DC.GetAllRunningSessions()[0].Distance.Should().Be(_running.Distance);
            DC.GetAllRunningSessions()[0].Time.Should().Be(_running.Time);
            DC.GetAllRunningSessions()[0].AverageSpeed.Should().Be(_running.AverageSpeed);
            DC.GetAllRunningSessions()[0].TrainingType.Should().Be(_running.TrainingType);
            DC.GetAllRunningSessions()[0].Comments.Should().Be(_running.Comments);
        }
示例#2
0
        private void maakNieuweTraining_Click(object sender, RoutedEventArgs e)
        {
            //Nieuwe loop aanmaken
            DateTime     _when         = (DateTime)WhenCalender.SelectedDate;
            int          _distance     = int.Parse(distance.Text);
            TimeSpan     _time         = TimeSpan.Parse(time.Text);
            float        _averageSpeed = float.Parse(averageSpeed.Text);
            TrainingType _trainingType = (TrainingType)trainingType.SelectedItem;
            string       _comments     = comments.Text;

            DC.AddRunningTraining(_when, _distance, _time, _averageSpeed, _trainingType, _comments);
            this.Close();
        }