testing

Unit testing in AngularJS - Mocking Services and Promises

Deadly 提交于 2019-12-28 11:55:14
问题 In Angular everything seems to have a steep learning curve and unit testing an Angular app definitely doesn't escape this paradigm. When I started with TDD and Angular I felt that I was spending twice (maybe more) as much time figuring out just how to test and maybe even more just getting my tests set up correctly. But as Ben Nadel put it in his blog there are ups and downs in the angular learning process. His graph is definitely my experience with Angular. However as I have progressed in

Unit testing in AngularJS - Mocking Services and Promises

痞子三分冷 提交于 2019-12-28 11:55:07
问题 In Angular everything seems to have a steep learning curve and unit testing an Angular app definitely doesn't escape this paradigm. When I started with TDD and Angular I felt that I was spending twice (maybe more) as much time figuring out just how to test and maybe even more just getting my tests set up correctly. But as Ben Nadel put it in his blog there are ups and downs in the angular learning process. His graph is definitely my experience with Angular. However as I have progressed in

Why is it so bad to mock classes?

£可爱£侵袭症+ 提交于 2019-12-28 08:04:15
问题 I recently discussed with a colleague about mocking. He said that mocking classes is very bad and should not be done, only in few cases. He says that only interfaces should be mocked, otherwise it's an architecture fault. I wonder why this statement (I fully trust him) is so correct? I don't know it and would like to be convinced. Did I miss the point of mocking (yes, I read Martin Fowler's article) 回答1: Mocking is used for protocol testing - it tests how you'll use an API, and how you'll

Automatically refresh browser in response to file system changes?

99封情书 提交于 2019-12-28 06:26:20
问题 When doing web development, you frequently make changes and then refresh the browser. Is there an easy way to have a daemon listening for changes in the filesystem, and when there is one, to send a refresh message to Firefox or Safari? This would really improve your workflow and focus. You could keep your browser running in a separate screen, and when you're working on UI related changes, it would automatically refresh as you're working. It would be like using autotest when doing TDD. (See

How to compare Image objects with C# .NET? [closed]

孤人 提交于 2019-12-28 06:01:05
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . Can we compare two Image objects with C#? For example, check whether they are equal, or even better check how similar are their pixels? if possible, how? 回答1: You can use a set of tools called TestApi, which is an open-source library to aid unit testing. One of such API is called

A simple local SMTP server [closed]

落花浮王杯 提交于 2019-12-28 05:16:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I want to test a Java code for sending email. I don't want to use any commercial mail client or connect to any external mail providers (like Gmail or Yahoo). I would like to know if there is any software which allows a user to configure dummy email addresses and server (locally) which can be used in my software

Python imports for tests using nose - what is best practice for imports of modules above current package

浪尽此生 提交于 2019-12-28 04:51:23
问题 This is a question which is asked frequently in different forms, and often obtains "lol you're not doing it properly" responses. Pretty sure that's because there's a common sense scenario people (including me) are trying to use as an implementation, and the solution is not obvious (if you've not done it before). Would accept an answer which "lets the fly out of the bottle". Given project/ __init__.py /code __init__.py sut.py /tests __init__.py test_sut.py Where tests_sut.py starts: import

How to run golang tests sequentially?

只谈情不闲聊 提交于 2019-12-28 04:08:30
问题 When I run go test , my output: --- FAIL: TestGETSearchSuccess (0.00s) Location: drivers_api_test.go:283 Error: Not equal: 200 (expected) != 204 (actual) --- FAIL: TestGETCOSearchSuccess (0.00s) Location: drivers_api_test.go:391 Error: Not equal: 200 (expected) != 204 (actual) But after I run go test again, all my tests pass. Tests fail only when I reset my mysql database, and then run go test for the first time. For every GET request, I do a POST request before to ensure that there is data

django unit tests without a db

橙三吉。 提交于 2019-12-28 03:17:08
问题 Is there a possibility to write django unittests without setting up a db? I want to test business logic which doesn't require the db to set up. And while it is fast to setup a db, I really don't need it in some situations. 回答1: You can subclass DjangoTestSuiteRunner and override setup_databases and teardown_databases methods to pass. Create a new settings file and set TEST_RUNNER to the new class you just created. Then when you're running your test, specify your new settings file with -

how to implement application tests in xcode4?

ぐ巨炮叔叔 提交于 2019-12-28 02:39:09
问题 I'm trying to add some Tests for my application. Following the Document from Apple, I add two testing bundles to my project. The logic tests are no problem, but when I try to make the application tests on a device I always get the error that the logic tests don't run on a device. In Xcode 3 there is no problem with that. Only Xcode 4 throws this error... Any suggestions? Thanks, Tim 回答1: i was also having problems with setting up application tests in xcode4. A solution that worked for me was