Heshan
Heshan

Reputation: 985

How to do unit testing in Windows Phone 8.1 RT?

Anyone knows how to do unit testing in a WP 8.1 RT app? There is almost no resources in the internet about this or even WinRT.

Upvotes: 5

Views: 1418

Answers (1)

Fred
Fred

Reputation: 3362

  1. Create a new project inside your solution. Choose a Unit Test App template (see screenshot).
  2. Create a test class with a test method inside that project. This could look like this:

    [TestClass]
    public class FooTestUnit
    {
        [TestMethod]
        public void TestFooBarProperty () {
            int referenceValue = 42;
            int actualValue = methodToTest();
            Assert.AreEqual(referenceValue, actualValue);
        }
    }
    

    }

  3. From the main menu choose: Tests / Run all tests.

enter image description here

Upvotes: 5

Related Questions