2 of 2 changed title to better fit question text

Is it ok to use static (compile-time) assertions in unit tests?

Or more generally: to trigger compiler errors in test projects if something that can be checked at compile time is wrong?