public void TestServiceMethodShouldCallRepoMethodOnce() { //Given var mockRepo = new Mock <IWatchRepository>(); var service = new WatchService(mockRepo.Object); var alarmCode = 1; //When mockRepo.Setup(mr => mr.ReadAllAlarmSubscriptionsByAlarmCode(It.IsAny <int>())).Returns(It.IsAny <List <AlarmWatch> >()); service.GetAlarmSubscriptionsByAlarmCode(alarmCode); //Then mockRepo.Verify(mr => mr.ReadAllAlarmSubscriptionsByAlarmCode(It.IsAny <int>()), Times.Once); }