Ejemplo n.º 1
0
 public IActionResult AddGoalLog(LogAddGoalLogViewModel data)
 {
     if (GoalLogViewModelToInterface(data) != null)
     {
         if (_goalLogLogic.Add(AuthController.GetAuthUserId(User), GoalLogViewModelToInterface(data)))
         {
             return(RedirectToAction("Index"));
         }
     }
     return(RedirectToAction("Index"));
 }
Ejemplo n.º 2
0
        public void GoalLog_Add_GoalShouldBeAdded_ValidationSucceeded()
        {
            var user = new UserDto
            {
                Id = 1,
            };
            var goallog = new GoalLogDto
            {
                Calories = 2500,
                DateTime = DateTime.Now,
                User     = user,
            };

            var expected = true;
            var actual   = _goallogLogic.Add(user.Id, goallog);

            Assert.AreEqual(expected, actual);
        }