public void GetAutitoryShedule_ShouldCallOnce() { //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 try { sheduleService.GetAutitoryShedule(It.IsAny <int>()); uow.Verify(x => x.Shedules, Times.Once); } catch (Exception ex) { Assert.That(ex.Message.Contains("You are not registered")); uow.Verify(x => x.Shedules, Times.Never); } //assert }
public IEnumerable <SheduleModel> GetAuditoryShedule(int number) { return(ManagemantMap.Map <IEnumerable <SheduleDTO>, IEnumerable <SheduleModel> >(SheduleLogic.GetAutitoryShedule(number))); }