내 단위 테스트 날MOQ 없음 호출은
. ": X => x.GetCount (It.IsAny()() It.IsAny) 어떤 호출이 수행되지 구성 설정"을 제공 수행되지 이것은 내 테스트 클래스는
private IService Client = null; public void CountChecks() { Client = new ServiceClient(); var _amount = Client.GetCount(value01, value01); }
입니다 :
public class CountChecksClassTests { private Mock<IService > service { get; set; } private CountChecksClass { get; set; } [TestInitialize] public void Setup() { service = new Mock<IService>(); service.Setup(x => x.GetCount(It.IsAny<DateTime>(), It.IsAny<DateTime>())); checker = new CountChecksClass(); } [TestMethod()] public void GetCountTest() { checker.CountChecks(); service.Verify(x => x.GetCount(It.IsAny<DateTime>(), It.IsAny<DateTime>())); } }
내가 테스트를 디버깅, 메소드가 호출되는
이 아래의 방법이다. 그래서, No 호출이 수행되는 이유는 무엇입니까? 오류가 service.Verify(x => x.GetCount(It.IsAny<DateTime>(), It.IsAny<DateTime>()));