Not every vsts edition has the coded UI test function. Because we don't need to consider the budget issue, we use the Ultimate Edition directly, find a link on Microsoft's website to compare functions of different versions:
Ref: http://www.microsoft.com/visualstudio/en-us/products#compareTable
After the ultimate version is installed, the vsts Program Group has two more options than the previous vs version: Team Foundation server tool and Microsoft test Manager 2010, both are related to TFs.
Open vsts 2010 and create a test project. By default, the file unittest1.cs is used instead of the coded UI test template.
After creating a coded UI test, you will feel that the coded UI test is basically the same as the unit test organization.
Namespace testproject1 <br/>{< br/> /// <summary> <br/> // summary description for codeduitest1 <br/> /// </Summary> <br/> [codeduitest] <br/> public class codeduitest1 <br/>{< br/> Public codeduitest1 () <br/>{</P> <p >}</P> <p> [testmethod] <br/> Public void codeduitestmethod1 () <br/>{</P> <p >}</P> <p> # region additional test attributes </P> <p> // use testinitialize to run code before running each test <br/> [testinitialize ()] <br/> Public void mytestinitialize () <br/>{</P> <p >}</P> <p> // use testcleanup to run code after each test has run <br/> [testcleanup ()] <br/> Public void mytestcleanup () <br/>{</P> <p >}</P> <p> # endregion </P> <p> // <summary> <br/>/ // gets or sets the test context which provides <br/> // information about and functionality for the current test run. <br/> // </Summary> <br/> Public testcontext <br/> {<br/> Get <br/>{< br/> return testcontextinstance; <br/>}< br/> set <br/>{< br/> testcontextinstance = value; <br/>}< br/> private testcontext testcontextinstance; <br/>}< br/>}
Test property comparison for MS unit test, coded UI test, nunit:
Unit Test |
Coded UI Test |
Nunit |
Testclass |
Codeduitest |
Testfixture |
Classinitialize |
X? |
Testfixturesetup |
Testinitialize |
Testinitialize |
Setup |
Testmethod |
Testmethod |
Test |
Testmethod |
Testmethod |
Test |
Testcleanup |
Testcleanup |
Teardown |
Classcleanup |
X? |
Testfixtureteardown |
However, since unit test is a code test, coded UI test is a test at the User Function/interface level. Its specific applications will certainly be somewhat different.