我需要为JUnit测试访问和Android方面。
I need to access and Android context for a JUnit Test.
我曾尝试使用MockContext和扩展AndroidTestCase但每次我得到一个错误说(存根!)
I have tried using MockContext and extending the AndroidTestCase but each time I get an error saying (stub!)
有关使用,而不是一个JUnit测试AndroidTestCase什么? AndroidTestCase将提供它需要的地方可以使用的getContext()上下文
What about using AndroidTestCase instead of a JUnit test? AndroidTestCase will provide a Context with getContext() that can be used where it's needed.
上一篇:与System.Collections中的命名空间使用时的IEnumerable报道编译器错误编译器、错误、空间、System
下一篇:如何使听者的datepickers在Android的取消按钮?听者、按钮、datepickers、Android