コード例 #1
0
        private TrainingSensation AddTrainingSensation()
        {
            TrainingSensation trainingSensation = new TrainingSensation();

            AddAndAssertBaseEntityInfo(trainingSensation);
            return(trainingSensation);
        }
コード例 #2
0
        public void TestTraining()
        {
            Objective         objective             = AddObjective();
            Training          training              = new Training();
            string            description           = Guid.NewGuid().ToString();
            double            speed                 = new Random().NextDouble();
            int               trainingLengthHours   = new Random().Next(0, 24);
            int               trainingLengthMinutes = new Random().Next(0, 60);
            int               trainingLengthSeconds = new Random().Next(0, 60);
            int               trainingDay           = new Random().Next(1, 31);
            int               trainingMonth         = new Random().Next(1, 12);
            int               trainingYear          = new Random().Next(2019, 2021);
            int               trainingHour          = new Random().Next(0, 24);
            int               trainingMinute        = new Random().Next(0, 60);
            int               trainingSecond        = new Random().Next(0, 60);
            TrainingType      trainingType          = AddTrainingType();
            TrainingSensation trainingSensation     = AddTrainingSensation();

            training.Description           = description;
            training.ObjectiveId           = objective.Id;
            training.Speed                 = speed;
            training.TrainingLengthHours   = trainingLengthHours;
            training.TrainingLengthMinutes = trainingLengthMinutes;
            training.TrainingLengthSeconds = trainingLengthSeconds;
            training.TrainingDay           = trainingDay;
            training.TrainingMonth         = trainingMonth;
            training.TrainingYear          = trainingYear;
            training.TrainingHour          = trainingHour;
            training.TrainingMinute        = trainingMinute;
            training.TrainingSecond        = trainingSecond;
            training.TrainingType          = trainingType;
            training.TrainingSensation     = trainingSensation;

            Assert.AreEqual(training.Description, description);
            Assert.AreEqual(training.ObjectiveId, objective.Id);
            Assert.AreEqual(training.Speed, speed);
            Assert.AreEqual(training.TrainingLengthHours, trainingLengthHours);
            Assert.AreEqual(training.TrainingLengthMinutes, trainingLengthMinutes);
            Assert.AreEqual(training.TrainingLengthSeconds, trainingLengthSeconds);
            Assert.AreEqual(training.TrainingDay, trainingDay);
            Assert.AreEqual(training.TrainingMonth, trainingMonth);
            Assert.AreEqual(training.TrainingYear, trainingYear);
            Assert.AreEqual(training.TrainingHour, trainingHour);
            Assert.AreEqual(training.TrainingMinute, trainingMinute);
            Assert.AreEqual(training.TrainingSecond, trainingSecond);
            Assert.AreEqual(training.TrainingType, trainingType);
            Assert.AreEqual(training.TrainingSensation, trainingSensation);
        }
コード例 #3
0
 public TrainingSensation Add(TrainingSensation trainingSensation)
 {
     throw new NotImplementedException();
 }
コード例 #4
0
 public ActionResult <TrainingSensation> Update(Guid id, [FromBody] TrainingSensation trainingSensation)
 {
     trainingSensation.Id = id;
     return(Singleton.TrainingSensationUpdate.ExecuteUpdate(trainingSensation));
 }
コード例 #5
0
 public ActionResult <Guid> Add([FromBody] TrainingSensation trainingSensation)
 {
     return(Singleton.TrainingSensationAdd.ExecuteAdd(trainingSensation));
 }