Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [unit-test-data]

The tag has no usage guidance.

0
votes
1answer
79 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 ...
-1
votes
1answer
97 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 ...
3
votes
2answers
124 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(); ...
2
votes
3answers
136 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) { /* ...
2
votes
3answers
809 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 ...
4
votes
2answers
345 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 ...
5
votes
2answers
326 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 ...
15
votes
2answers
3k 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 ...