Add ScopeGuard unit test