Unit testing is a method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine if they are fit for use.
0
votes
0answers
12 views
I can't get mock to work
I'm trying to use a mock for unit testing with Python/Django but I just can't get it to work. The mock acts like it has never been called.
tests.py
from my_module import my_library
my_library = ...
0
votes
0answers
4 views
How to check if value is nan in unittest?
I've got functions, which sometimes return NaNs with float('nan') (I'm not using numpy).
How do I write a test for it, since
assertEqual(nan_value, float('nan'))
is just like float('nan') == ...
2
votes
1answer
38 views
Test for click event using Jasmine test suite
I am using jasmine to test my application and right now no button exists in my code
but i want to write a test in which i can check that whether a click event is fired or not.
You can simply think ...
0
votes
1answer
8 views
Override default jasmine error message for matchers
I want to show some custom error message when any matcher fails , suppose i call this
expect(false).toBe(true);
obviously it would return false and error message would be
Expected false to be ...
0
votes
2answers
14 views
How can I create a partial (hybrid) mock in googlemock?
Google suggests delegating calls to a parent object when you need to invoke functionality of the real object, however this does not really create a partial (hybrid) mock. When invoking the real ...
0
votes
0answers
12 views
How to unittest that a django model method called with unittest.mock?
I'm having a hard time understanding how to use unittest.mock library.
I have this model:
from django.db import models
class Data(models.Model):
field1 = models.CharField(max_length=50)
...
0
votes
0answers
11 views
Nose/unittest – how write result in separate streams?
Guys,
I need your help.
I have problem - unittest/nose sent result in one stream, but I want to split stdout and stderr streams. TextTestRunner - is test runner class that displays results in ...
0
votes
1answer
12 views
How can I solve Error during testing Angular Js in netbeans?
After following this example
https://netbeans.org/kb/docs/webclient/html5-js-support.html
I always get that error:
Exception in thread "main" java.lang.NoClassDefFoundError: ...
0
votes
0answers
12 views
Using Tessy with Subversion
I have an embedded C project which uses subversion for source control. I want to use Tessy for unit testing and have these tests archived in subversion too. However, it generates many small files ...
1
vote
0answers
19 views
How do you mock a break statement in RSpec?
I am having an issue with a LocalJumpError being raised when the example reaches the break statement.
Does anyone know how to stub out break, or if this is even the right approach?
The Method:
def ...
0
votes
0answers
11 views
Tipps on SSDT development process and best practices regarding automated unit / integration tests
I am searching for days now on several forums, blogs, msdn etc. but I was not able to find any guidance on this topic so far. I will try to explain this post in a more detailed manner because I think ...
1
vote
0answers
23 views
Unit Testing Controllers in PHP - Should I mock everything?
Basically, i have an application written in Zend Framework 2.
My Controllers are pretty good tested, and while i made this experience i asked my self:
"Should i mock everything i can possibly mock?"
...
-3
votes
0answers
22 views
CoreData unit test real-life examples needed [closed]
I'm investigating unit testing for iOS at the moment and one of topic of my investigation is testing of CoreData. I've found how to set up inmemory storage and clean it up for each test and put it in ...
1
vote
1answer
29 views
Should I avoid Di when classes are testable with black box testing
I'm implementing something similar to nand2tetris project except I write all my code in java not using HDL and I'm writing tests on my own.
For problem ilustration:
I have implemented nand logic gate ...
0
votes
0answers
12 views
Jasmine recomended way to write test?
I am using jasmine along with jasmin-species for GWT language .
I have a following scenario
'In order to access my account',
'I want to Sign In to the application as a user'
...