Function to get current value or default from a string of two values
Potential Issues


a naive string replacement could change more than just the placeholders; for instance, when another part of the script uses the same string as a literal
the replacement can introduce a value with the same format {%}; your sql has no way of knowing that this is a replacement value, and since the format matches that of a place holder, it will be ignored and the default value will be taken
make sure the sql user of your unit test project has limited rights, because you don't know the exact sql that is going to run at runtime


If you insist on using a string replacement, try to manage escape characters and try to avoid false positives/negatives, both from sql and C# injection.