没有TDD可以进行单元测试吗?(Can do unit test without TDD? [closed])
我正处于一个我们不做TDD的项目,因为我们的老板和客户都是非常“老式”的人。 因为我无法通过TDD进行设计,但我对改变感到害怕,我想为自己的安全编写单元测试。 但是,这些单元测试将如何? 我是否必须为每个方法规范编写一个测试,以便他们按照预期的那样做? 我是否必须测试TDD等每个新功能但没有设计? 我心里一团糟。
提前致谢。
I'm in a project where we don't do TDD, because our bosses and the cliente are very "old styled" people. Because I can't do design through TDD but I feel fear to changes, I would like to write unit tests for my own safety. But, how those unit test would be? Do I have to write a test for each method specification for test that they do what it's supposed they do? Do I have to test for each new functionality like TDD but without design? I have a mess in my mind.
Thanks in advance.
原文:https://stackoverflow.com/questions/9348804
最满意答案
在style.xml中的父主题中添加此行
<item name="searchViewSearchIcon">@drawable/ic_action_search</item>
add this line in your parent theme in style.xml
<item name="searchViewSearchIcon">@drawable/ic_action_search</item>
相关问答
更多-
这两个是您需要覆盖以控制用户在SearchView上键入时以及用户单击搜索按钮时所需的方法: public class MyClass extends SherlockActivity implements SearchView.OnQueryTextListener{ ... @Override public boolean onQueryTextSubmit(String query) { return false; } @Override p ...
-
ActionbarSherlock SearchView是/是一个已知问题。 dev分支包含的支持,但它不完整,似乎他们仍然有建议的问题。 请参阅这里和这里的 github以供参考。 这里是一个指向ActionBarSherlock > SearchView Source的链接 SearchView in ActionbarSherlock is / was a known issue. The dev branch contains the support, however it is not compl ...
-
添加注释的代码部分不是完全解决了问题,但它很好。 @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater=new MenuInflater(getBaseContext()); inflater.inflate(R.menu.menu, menu) ...
-
它看起来像actionViewClass覆盖图标,它看起来不像yuo可以从这个类改变它。 你有两个解决方案: 与它一起生活,我认为这是用户体验和平台一致性方面的最佳选择。 定义你自己的actionViewClass It looks like the actionViewClass overides the icon and it doesn't look like you can change it from this class. You got two solutions: Live with it ...
-
Android:SearchView组件更改图标(无ActionBar)(Android: SearchView component change icon (no ActionBar))[2023-09-04]
可以使用AppCompat。 但是我使用了小黑客: mSearchView = (SearchView) searchViewMenuItem.getActionView(); int searchImgId = getResources().getIdentifier("android:id/search_button", null, null); ImageView v = (ImageView) mSearchView.findViewById(searchImgId); v.setImageReso ... -
您可能需要检查您的活动是否未导入错误的R文件(在这种情况下,它可能是从ActionBarSherlock而不是您的应用程序导入R)最坏的情况您可能需要手动将R添加到您的活动中。 喜欢 import your.app.namespace.R; 在类中并删除任何其他正在导入的R. You may need to check that your activities are not importing the wrong R file ( In this case it may be importing the ...
-
改变@drawable/abs__ic_menu_moreoverflow_normal_holo_light 至 @drawable/abs__ic_menu_moreoverflow_normal_holo_dark 你会得到“白色”溢出图标。 Change @drawable/abs__ic_menu_moreoverflow_normal_holo_light to @drawable/abs__ic_menu_moreoverflow_normal_holo_dark and you will g ...
-
Android ActionBarSherlock SearchView更改图标(Android ActionBarSherlock SearchView change icon)[2022-04-24]
在style.xml中的父主题中添加此行- @drawable/ic_action_search
add this line in your parent theme in style.xml- @drawable/ic_action_search
-
那么,错误本身是由ActionBarSherlock库引起的,你可以在这里找到GitHub中的问题: https : //github.com/JakeWharton/ActionBarSherlock/issues/685 此处发布的评论是我的解决方案: https : //github.com/JakeWharton/ActionBarSherlock/issues/685#issuecomment-11670533 转到ABS库项目的res / values-v14 / abs_themes.xml: ...