title: How can I test methods containing Application.Current.Properties.ContainsKey("token")
body: <p>I am trying to test the login for my Xamarin App, but in order for the App to work, I have to create a token. The method for that looks like this:</p>
  
  <pre><code>public string RetrieveToken()
  {
      if (Application.Current.Properties.ContainsKey("token"))
      {
           return Application.Current.Properties["token"] as string;
      }
      return null;
  }
  </code></pre>
  
  <p>But as the test runs through I receive a NullReferenceError, because <code>Application.Current.Properties.ContainsKey("token")</code> can't be used within a test.
  So my question is if there is a way to evade that.</p>