Double values are not safe to compare, because of how double are stored in memory. I would advise you to use something like
if(Math.Abs(Thickness - new Thickness(2.1)) < TOLERANCE).
You can do a quick test and try to check something like:
var passed = false; if(0.2 + 0.1 == 0.3) passed = true;
And you'll see that it is