0

Jmock のホームページからmatchersについて読んだところ、一番上に文字列マッチャーに関する例がありました。例によると、文字列の照合は import static org.hamcrest.Matchers.*; と書くのと同じくらい簡単なので、私は理解できませんでした。次にstringContains関数を使用しますが、それは私の実装では機能しません。

私がしたいのは

new Expectations() {{
  mockedType.someFunction(with(   **match string here**    ) );
}};
4

1 に答える 1

0
new Expectations() {{
    allowing(mockedType).someFunction("My String"); when  ... ; will ... ; then ...
}};

働いているに違いない

于 2012-04-26T08:44:17.773 に答える