문제

I am using the rather good Delphi Mocks Framework, and am trying to create a Mock of a class that contains a method that has 'side-effects', i.e. it is a read operation, and in the real-world implementation it sets the contents of a buffer, if the read is successful. So my question is, how do I mock that 'side-effect'?

도움이 되었습니까?

해결책

You can use the WillExecute method on the mock and pass in a delegate (see Delphi.Mocks.pas for it's signature) that does whatever you want.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top