Rules to Better Unit Tests
- Do you know why unit tests are important?
- What are the different types of test you can have?
- Do you know what unit tests to write and how many?
- Do you make sure that the test can be failed?
- Do you write unit tests to confirm bugfixes? (aka Red-Green-Refactor)
- Do you know the most popular unit and integration testing frameworks for .NET applications?
- Do you know good sources of information to get started with Unit Testing?
- Do you have a Continuous Integration (CI) Server?
- Do you follow naming conventions for tests and test projects?
- Do you know how to structure a unit test (aka the 3 a's)?
- Do you have tests for difficult to spot errors (e.g. arithmetic, rounding, regular expressions)?
- Do you run Unit Tests in Visual Studio?
- Do you isolate your logic and remove dependencies on instances of objects?
- Do you know the most popular automated UI testing frameworks (aka functional testing)?
- Do you have tests for Performance?
- Do you Health Check your infrastructure?
- Do you isolate your logic from your IO to increase the testability?
- Do you reference the issue ID when writing a test to confirm a bugfix?
- Do you test your JavaScript?
- Do you use Live Unit Testing to see code coverage?
- Do you write integration tests to validate your web links?
- Do you unit test your database?
- Do you use IntelliTesting to save you in testing?
- Do you know the best test framework to run your integration tests?
- Do you follow the standard naming conventions for tests?
- Do you have a integration test for your send mail code?
- Do you have a standard 'Help' menu that includes a way to run your unit tests?
- Do you know how to run nUnit tests from within Visual Studio?
- Do you know the right version and config for nUnit?
- Do you write Integration Test for Dependencies - e.g. DLLs?
- Do you use subcutaneous tests?
- Do you use IApiMarker with WebApplicationFactory?