Table of Contents |
---|
Tests
Where data access or integration tests can write their output data?
Tests should never write their output data into test-data/ directory. That directory is used for input data files used the tests.
Make sure that output files are deleted if your test code behaviour depends on them.
Where can I find data files which can be used in data access or integration tests?
All data files which are used in the data access or integration tests must be located in the test-data/ directory
Name the unittest class of your class xxxTest.*
Why?
To make it easy to find the tests for a class.
Unit test categories.
- Uncategorized - unit test. Fast test to test a class in isolation.
- TestCategory.Integration - integration test where multiple classes / components are used
- TestCategory.DataAccess - specific integration test where file is accessed (read / write)
- TestCategory.WindowsForms - specific integration where form is shown
- Pefromance - unit or integration test where speed of the code is measured.
- Jira - test describing a bug in Jira. The test should specify for which issue it was created.
When test shows forms and accesses files - use TestCategory.Integration as a category, no multiple categories!!
Build Server and Automatic Testing
What should I do before checking code in?
Every developer is strongly adviced to use TeamCity pre-tested commit feature if commit is not tested locally! Visual Studio plugin for TeamCity can be downloaded from My Settings & Tools menu on build server.
The rule is: if someone checks code in that breaks build (new failing tests) - build must be reverted if it is not fixed within 30 min and the author of the broken tests does not take responsibility on TeamCity, and can't be reached. Use the following script to revert a specific build: build/tools/revert-svn-changes.cmd
One class per .cs file
Why? Because your checkins are much clearer and it confuses because in most files this is the case
When? Nearly always
Except...you have a lot of really small classes with tight coupling to play some test scenario. Then it might be clearer to have them together.
Hibernate
Hibernate mappings next to your .cs files*
Why?
To make finding hbm files easy for everyone
When? Always.
Except..There are some 'old' mapping files (DelftTools.hbm.xml and SharpMapGis.hbm.xml). Then convention is not applied there yet.
Aspect Oriented Programming
...
Children Display |
---|