Address false negative tests

The EnsureTypeIsNotGeneric method is not tested correctly.
Made GuardClauseAssertion to support generic.
Remove the duplicated code and test

Removed the duplicated code and test from the changes of the previous
commit to support generic.
Addressed the code analysis error.