I am working on a unit test for a Windows Phone 7 Silverlight app. The code for the test looks like this:
[TestMethod]
[Asynchronous]
public void StuffIsLoading()
{
WaitFor(_repository, "LoadingStuffComplete");
var viewModel = new MainPageViewModel(_repository);
EnqueueCallback(() => Assert.IsTrue(viewModel.Stuff.Count > 0));
EnqueueTestComplete();
}
This is based on an old blog post by Justin Angel located here:http://bit.ly/34LQXP
I am using the Silverlight testing framework that was released with the latest Silverlight Toolkit. When I build this I get the following compiler error:
'EnqueueCallback' is not supported by the language
I'm new to Silverlight and WP7 development so what am I missing? Is there a better way to test async operations with events?