0

I have just created a sample Windows Phone Unit Test app for checking things out. But i am not able to test a sample method. the weird thing is Visual Studio test runner is working fine but Resharper Unit Test Runner just throwing Exception. Exception :- enter image description here

anybody know about it ?

loop
  • 9,002
  • 10
  • 40
  • 76

1 Answers1

0

To test this I created brand new WP8 project. "Program" is as simple as they get, using default MainPage and all.

enter image description here

I just added MainViewModel, having only one property

public string MyProperty
{
    get { return _myProperty; }
    set { _myProperty = value; OnPropertyChanged(); }
}

After that I added the WP8 Unit Test project and replaced default UnitTest1.Testmethod1 with

[TestClass]
public class MainViewModelTests
{
    [TestMethod]
    public void MyPropertyTest()
    {
        string expected = "expected";
        var vm = new MainViewModel();

        vm.MyProperty = expected;
        Assert.AreEqual(expected, vm.MyProperty);    
    }
}

Both MS Test runner and ReSharper are working fine and test passed.

enter image description here

I am using Visual Studio 2012 v11.0.61030.00 Update 4 and JetBrains ReSharper v7.1 build 7.1.3000.2259.

If interested you can find the Visual Studio solution from GitHub @ https://github.com/mikkoviitala/wp8-unit-test-example and try it out yourself. If it's not working for you then I can't think of anything other than reinstalling ReSharper and hope for the best.

Mikko Viitala
  • 8,344
  • 4
  • 37
  • 62