Add unit tests for SA1021 and SA1022

Fixes #207, #208, #271, #272