Dear Friend,
If VIewState("Test") is nothing, then this will error because there is no instantiated value to call an instance method.
If ViewState("Test") is string.empty, then this is a valid string value, but empty (not null though).
Then try to check this by
if (ViewState("Test").Equals("")) then
I hope this will help you out.
Thanks