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.
我从 Jmock 的主页上读到了 matchers ,在最上面有一个关于字符串匹配器的例子。我不明白,因为根据示例,匹配字符串就像编写 import static org.hamcrest.Matchers.*; 一样容易。然后使用 stringContains 函数,但这对我的实现不起作用。
我想做的就是
new Expectations() {{ mockedType.someFunction(with( **match string here** ) ); }};
new Expectations() {{ allowing(mockedType).someFunction("My String"); when ... ; will ... ; then ... }};
必须工作