У нас есть несколько модульных тестов Silverlight, успешно запущенных в VS 2010.
Я использую платформу модульного тестирования Silverlight (http://silverlight.codeplex.com).
Например:
/// <summary>
/// test the loading of the big org strucutre from the server
/// this operation has a timeout attached.
/// </summary>
[TestMethod]
[Asynchronous]
[TimeoutAttribute(60100)]
public void LoadOrgStructure()
{
_loadOrgStructureStart = getCurrentTicks();
OrgStructureMemberDAC.Instance.GetOrganisationStructure(new EventHandler<GetOrganisationStructureOrgStructureMemberVOCompletedEventArgs>(delegate(object s, GetOrganisationStructureOrgStructureMemberVOCompletedEventArgs e)
{
//only run the following code in time
if (getElapsedMilliseconds(_loadOrgStructureStart) <= 60000)
{
if (e.Error != null)
{
//Clientside error
throw e.Error;
}
else if (e.Result.Error != null)
{
//Serverside error
throw new AssertFailedException(e.Result.Error.Message);
}
else
{
Assert.IsNotNull(e.Result.Result); // there must be root elements
Assert.IsTrue(e.Result.Result.Count > 0);
Assert.IsNotNull(e.Result.Result[0].ChildMemberLstObj); //there must be childs
Assert.IsTrue(e.Result.Result[0].ChildMemberLstObj.Count > 0);
EnqueueTestComplete();
}
}
}));
}
Когда я запускаю этот тест в VS 2010, окно браузера открывается, и тест успешно выполняется.
Теперь я хочу запускать такие асинхронные тесты с моей TFS-2010-Build. Но я не знаю, как начать этот тест со сборки. Это возможно?