title: Xamarin Forms Unit Testing
body: <p>What is the approach to write unit tests for Xamarin Forms application (as opposed to Xamarin Traditional which is Xamarin.Android, Xamarin.IOS, or Xamarin.UWP)?</p>
  
  <p>Can anyone provide a good explanation for Unit Tests in Xamarin.Forms vs Unit Tests in Xamarin Traditional?</p>
  
  <p>A good explanation article how to implement Xamarin.Forms tests and are they even needed or should we write Unit Tests for each platform instead?</p>
  
  <p>I have read a number of articles out there but I haven't found one that starts from creating the unit test project type in Visual Studio to writing and running the tests.  </p>
  
  <p>They mostly start somewhere in the middle discussing DI or ServiceLocator (like this one <a href="http://arteksoftware.com/unit-testing-with-xamarin-forms-dependencyservice/" rel="noreferrer">http://arteksoftware.com/unit-testing-with-xamarin-forms-dependencyservice/</a>).  </p>
  
  <p>Or, on the other hand, they mix Xamarin.Forms with Xamarin.Android (or IOS) unit testing (like this one: <a href="http://www.dsibinski.pl/2017/03/unit-testing-xamarin-application/" rel="noreferrer">http://www.dsibinski.pl/2017/03/unit-testing-xamarin-application/</a>).</p>
  
  <p>Or, they mix Portable vs Shared like in the case of this one <a href="http://www.alteridem.net/2015/12/21/testing-xamarin-projects-using-nunit-3/" rel="noreferrer">http://www.alteridem.net/2015/12/21/testing-xamarin-projects-using-nunit-3/</a>.</p>
  
  <p>What I understand so far is that I could use regular Unit Test project in VS and use either MSTest or NUnit.  Or, I can write platform specific unit tests for each platform.</p>
  
  <p>All of this is very confusing because authors seem to mix the terms all over the place.</p>
  
  <p>A detailed answer with supporting examples would be highly appreciated as I am entirely a beginner in this area.</p>