Example #1
0
 public void TestServiceShouldCallRepoMethodOnce()
 {
     //Given
     var mockRepo = new Mock<IWatchRepository>();
     var service = new WatchService(mockRepo.Object);
 
     //When
     mockRepo.Setup(mr => mr.RemoveAlarmSubscriptionFromWatch(It.IsAny<AlarmWatch>()));
     service.DeleteAlarmSubscriptionFromWatch(new AlarmWatch());
 
     //Then
     mockRepo.Verify(mr => mr.RemoveAlarmSubscriptionFromWatch(It.IsAny<AlarmWatch>()));
 }