Questions tagged [stub-data-generation]
9 questions
16
votes
1 answer
Unit testing - stubbing an SqlDataReader
We have an n-tier web application that pulls data from SQL Server. Our Data Access logic returns an SqlDataReader whose data is then used to create our Business objects (a.k.a. Data Transfer objects).
We wish to build unit tests to check our code…

DrGriff
- 4,394
- 9
- 43
- 92
6
votes
4 answers
Save object in debug and than use it as stub in tests
My application connects to db and gets tree of categories from here. In debug regime I can see this big tree object and I just thought of ability to save this object somewhere on disk to use in test stubs. Like this:
mockedDao =…

Vladimir
- 12,753
- 19
- 62
- 77
5
votes
3 answers
Test data generator for JPA or Hibernate
Are there any tools or libraries that can be used to generate test data using JPA or entity beans? I believe this will be very helpful for unit testing where we can have an in memory database with data dynamically generated just when we start our…

Bala
- 1,193
- 2
- 12
- 34
3
votes
1 answer
Trouble using Autofixture's CreateProxy to use Likeness, SemanticComparison features
In an earlier question I asked about Autofixture's CreateProxy method, a potential bug was identified.
I don't think this failing test is as a result of that, but rather my continued confusion about how the Likeness.Without(...).CreateProxy()…

Jeff
- 2,191
- 4
- 30
- 49
1
vote
2 answers
Examples for creating stub data structures with dynamic JVM Languages?
Over the years, I think I have seen and tried every conceivable way of generating stub data structures (fake data) for complex object graphs. It always gets hairy in java.
* * * *
A---B----C----D----E
(Pardon cheap UML)
The key issue…

krosenvold
- 75,535
- 32
- 152
- 208
1
vote
1 answer
Grunt-stubby and protractor task
I use Grunt in my project with angular and node. For the tests i use cucumber + protractor + grunt-stubby here is my register task from Gruntfile.js
grunt.registerTask('test', [
'selenium_start',
'clean:server',
…

Toni Chaz
- 651
- 11
- 22
1
vote
2 answers
How do I stub a method for a class generated at run-time with Rails minitest?
I want to stub out a call to a 3rd party component, but finding this pretty challenging in Rails mini-test. I'll start with the most basic question above. Here is some very simplified pseudo code to better explain what I'm trying to do:
class…

Gusto
- 53
- 1
- 6
0
votes
1 answer
using lazy C++ for stub generation
Have you ever used lazy C++?
I am trying to create .CPP files out of .H files. In forum I read that it is possible with your tool but I tried touse it and I didn't succeed.
Can you help me?
I used the option -c with a Test.h file with exactly the…

Abruzzo Forte e Gentile
- 14,423
- 28
- 99
- 173
0
votes
2 answers
Unit testing - How to set up test data when stubbing database data
In our unit testing, I've got a stub object that is creating a set of data in memory to be used during unit testing so that the live database is not used.
I have unit tests that check the number of rows returned from this set using the query under…

Steve Ward
- 1,207
- 3
- 16
- 42