public void Update_TryToEdit_RepositoryShouldCallOnce()
        {
            //arrange
            sheduleRepository.Setup(x => x.FindById(It.IsAny <int>())).Returns(new Shedule()
            {
                Auditorys_Number = It.IsAny <int>(),
                Day    = It.IsAny <int>(),
                Pair   = It.IsAny <int>(),
                UserId = It.IsAny <int>(),
                Group  = It.IsAny <int>()
            });

            //act
            sheduleService.Update(new SheduleDTO
            {
                Auditorys_Number = 5,
                Day    = 5,
                Pair   = 5,
                UserId = 5,
                Group  = 5
            });

            //assert
            uow.Verify(x => x.Shedules.Update(It.IsAny <Shedule>()), Times.Once);
        }
示例#2
0
 public void Put(int id, [FromBody] SheduleModel value)
 {
     value.Id = id;
     SheduleLogic.Update(SheduleControllerMapper.Map <SheduleModel, SheduleDTO>(value));
 }