I try to avoid the Arrange-Act-Assert (AAA) pattern for unit tests. I find that with multiple test methods depending on the same starting conditions, the ‘arrange’ code becomes repetitive, which makes tests tedious to write and difficult to maintain. My preferred approach is to set one test fixture per test class, the test fixture being …
Monthly Archives: April 2014
The unit in unit-testing
Interpreted literally, unit testing means testing each class individually. Complete isolation is, however, difficult given that a class typically interacts with other classes. Therefore, for this definition of unit testing to hold, collaborating classes must be replaced with fakes in a test. But developers confront two main problems when using these mock objects. First, tests …
Learning BASE64 encoding
The purpose of BASE64 is to communicate binary data as text, using only characters that exist on most computer platforms. These safe characters form the BASE64 alphabet and are the letters A to Z and a to z, the numerals 0 to 9, and the characters / and +. Other ways of representing bytes as text exist. …
How we use SQL Server Data Tools
This post describes our process for developing databases with SQL Server Data Tools (SSDT) in Visual Studio. For it to work, the conventions below must be respected. Use the live database as the gold standard for schema objects (and data). Deploy only database projects that have been built successfully. Deploy to a database that matches the schema of …