コード例 #1
0
        public void B_StartWorkoutTest()
        {
            int wId = wcRepository.GetAll().Where(x => x.workout_title.Equals("TestRepositoryWorkout", StringComparison.InvariantCultureIgnoreCase))
                      .FirstOrDefault().workout_id;
            workout_active wa = new workout_active()
            {
                workout_id = wId,
                start_date = DateTime.UtcNow.Date,
                start_time = DateTime.UtcNow.TimeOfDay,
                status     = false
            };

            wcRepository.StartWorkout(wa);
            _context.SaveChanges();
            var result = wcRepository.GetActiveWorkouts(wId).ToList();

            Assert.AreNotEqual(null, result);
            Assert.AreNotEqual(0, result.Count());
            Assert.AreEqual(false, wa.status);
            Assert.AreEqual(null, wa.comment);
            Assert.AreNotEqual(null, wa.start_date);
            Assert.AreNotEqual(null, wa.start_time);
            Assert.AreEqual(null, wa.end_date);
            Assert.AreEqual(null, wa.end_time);
        }
コード例 #2
0
 public void StartWorkout(workout_active wa)
 {
     workoutCollectionRepository.StartWorkout(wa);
     unitOfWork.Commit();
 }