Moved Testing code from Sample to Test.