Running Silverlight Unit Tests in TFS 2010 Build

We have several Silverlight module tests that successfully run in VS 2010. I am using the Silverlight unit test environment ( http://silverlight.codeplex.com ).

Example:

/// <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();
            }
        }
    }));
}

When I run this test in VS 2010, the browser window is open and the test runs successfully. Now I want to run such asynchronous tests with my TFS-2010-Build. But I don’t know how to start this build test. Is it possible?

+3
source share
2 answers

Yes it is possible. Take a look at the following solution: How do I run Silverlight automated tests on a TFS build server?

, StatLight ( , Silverlight) TFS 2010 Silverlight .

+2

StatLight, . , , .

0

Source: https://habr.com/ru/post/1783630/


All Articles