public void Add(string name, int priority)
 {
     _goalsProvider.Insert(new Goal
     {
         Name            = name,
         Priority        = priority,
         Color           = "rgb(92,184,92)",
         MinHoursPerWeek = 2,
         MaxHoursPerWeek = 8
     });
     _goalsProvider.Save();
 }
        public void Add(string name, int priority)
        {
            var user = _usersProvider.GetById(UserId);

            _goalsProvider.Insert(new Goal
            {
                Name            = name,
                Priority        = priority,
                Color           = "rgb(92,184,92)",
                MinHoursPerWeek = 2,
                MaxHoursPerWeek = 8,
                User            = user
            });
            _goalsProvider.Save();
        }
Example #3
0
        public void SaveValidGoal_AdedInDb()
        {
            var goal = new Goal
            {
                Id       = 15,
                Name     = "Test goal",
                Priority = 10,
            };

            mockDbProvider.Insert(goal);
            mockDbProvider.Save();

            mockDbSet.Verify(s => s.Add(It.IsAny <Goal>()), Times.Once());
        }