Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
模擬サービスを渡すクラスがあります。このクラスにはキャッシュがあるため、メソッドを2回実行すると、最初の実行でサービスで呼び出された関数が2回目の実行で呼び出されないことが予想されます。それをテストする方法はありますか?
mock expects 'function never
また
mock not expects 'function
関数であることに気づかなかった、または一度もなかったため、直後のコードは引数と見なされるため、空白行を残すか、;を使用するか、空のパラメーターを設定します
例えば:
mock expects 'function never()
また、
mock expects 'function withArgs(arg1, arg2) returns true once()