Have you tried to explicitly define test2 as string?
IndexOf, Contains, etc are STRING functions!
When you are doing Teste2 = teste you are changing its definition from string into double, which is the Test definition
change the line to teste2 = teste.As(String) and see if it works