Skip to main content

Questions tagged [unit-test-data]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-4 votes
1 answer
345 views

Unit testing data-transformation functions that call external APIs

Lets say you have a class that has the responsibility producing a set of finished data, but the method of producing that data is intentionally an implementation detail and as such should be left ...
Darinth's user avatar
  • 127
0 votes
1 answer
203 views

Unit/Component testing using In Memory DB

I am writing Unit/Component test using In Memory DB. When I write Unit/Component test, I came across with the following question. I have the following two BL methods. ToCreate ToGet So when I ...
Jeeva Jsb's user avatar
  • 101
-1 votes
1 answer
160 views

Best practices on unit tests for consecutive functions

Let's say we have function A and function B which perform consecutive operations on some data, with B never receiving the data before A processes it. Function A makes exhaustive checks on potential ...
Paul Razvan Berg's user avatar
3 votes
2 answers
1k views

Is it acceptable to test based on test output data rather than input data in unit tests?

I'm used to write unit tests with assertions which are based on the input, e.g. (hopefully self-explanatory and let's assume that using random test data is fine) int a = random(); int b = random(); ...
Kalle Richter's user avatar
2 votes
3 answers
178 views

Using methods that are not under test within a unit test for a different method?

I'm building a Sudoku generator. I have a board class with a number of methods: public class Board { public Board() { /* Creates an empty board */ } public bool ValidateRow(int row) { /* ...
Shaun Hamman's user avatar
2 votes
3 answers
2k views

Reading a file before testing a method - it is an integration test or a unit test?

Let's say I write a parser. It takes an argument that is a String and does something with that. This String can be very long so keeping it in a test class can dirty my code. I think that it would be ...
tdudzik's user avatar
  • 141
4 votes
2 answers
994 views

Does one need to mock concrete data objects?

I've been working on a large project where much of the code is not under test. I have been able to add some unit tests to functional areas of the code, and also to start mocking services but I have a ...
Zach Leighton's user avatar
5 votes
2 answers
398 views

Unit tests tactics

The only unit tests tactic I'm familiar with is comparing against golden data _ a predefined set of input data for which output is known (preferably including corner cases). I cannot think of any ...
superM's user avatar
  • 7,363
19 votes
2 answers
6k views

To load or not to load data for unit tests from external files

When unit testing I often find myself debating how much of the data I feed to, and expect back from my units under test, I should include in the actual test files. The tradeoff I constantly ...
DudeOnRock's user avatar
  • 1,079