Add unit tests for SA1021 and SA1022

Fixes #225, #226, #271, #272

# Blocked

This pull request is blocked on both #252 and #260.