New answers tagged unit-tests
1
What I usually do in such cases is I have a test for Put and a test for List. The test for Put might (and probably will) use the List method, but it focuses on the boundaries of the Put method. I will make sure that the code coverage for the Put method is complete within the TestPut.
Likewise, the TestList method would focus on the boundaries of List, ...
4
What you're observing is common whenever the job of a method is to change some internal state (like the set of things stored in an internal collection).
There are two options:
Recognize that the desired results are observable only through subsequent calls to other methods.
Add a way to observe the internal state directly.
This generally requires making ...
2
Alex is correct. In addition, you probably will want multiple tests per function covering both positive and negative cases. What happens if you try to get or delete a file that doesn't exist? What happens if the data source doesn't exist? How about if you don't have permissions? What if you want to put and have it add a new file vs modifying an existing ...
1
You're right that TestPut tests both Put and List, but that on its own doesn't mean List doesn't need its own unit test. For one thing, supposing TestPut were to fail, having a TestList would help you know whether the bug is in Put or List.
1
It depends on the test framework you are using. The frameworks I know allow you to define your own assertions. With that, you could define a time based assertion like assertSpecifiedBefore(<specification>, <date>), which checks the last modification date of the specification is not newer than the date of test creation (<date>).
0
Take a look at Microsoft Test Manager. Although not dependent on .net, it is fully integrated with Team Foundation System - so if you're not using TFS for work item management / scrum process - it will not work for you.
It does allow you to define standard and custom relationship and you can create your own transitions to invalidate tests if that is what ...
1
The short answer
You've been tricked into asking the wrong question by a process that is not designed to actually provide you any guidance your day-to-day tasks. See the pithy Q&A on the Programmers site for a pragmatic take on this:
http://programmers.stackexchange.com/questions/175393/iso-12207-verification-of-integration-and-unit-test-validation
...
Top 50 recent answers are included
