public void CheckInstanceFromFactory() { // act object teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri, TestConstants.DefaultCredentials); // assert Assert.IsInstanceOfType(teamProjectCollections, typeof(ITeamProjectCollections)); }
public void ListCollection_Default_ReturnListOfCollectionGreaterThan0() { // arrange ITeamProjectCollections teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri); string collectionName = TestConstants.TfsCollectionName; // act List <Collection> actual = teamProjectCollections.ListCollections(); // assert Assert.IsTrue(actual.Count > 0); }
public void ListCollection_Default_ReturnListOfCollection() { // arrange ITeamProjectCollections teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri); string collectionName = TestConstants.TfsCollectionName; // act object actual = teamProjectCollections.ListCollections(); // assert Assert.IsInstanceOfType(actual, typeof(List <Collection>)); }
public void CollectionExists_CollectionThatExist_ReturnTrue() { // arrange ITeamProjectCollections teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri); string collectionName = TestConstants.TfsCollectionName; // act bool actual = teamProjectCollections.CollectionExists(collectionName); // assert Assert.IsTrue(actual); }
public void CollectionExists_CollectionThatDoesnotExist_ReturnFalse() { // arrange ITeamProjectCollections teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri); string collectionName = Guid.NewGuid().ToString("N"); // act bool actual = teamProjectCollections.CollectionExists(collectionName); // assert Assert.IsFalse(actual); }
public static void AssemblyInit(TestContext context) { using (ITeamProjectCollections teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri, TestConstants.DefaultCredentials)) { if (!teamProjectCollections.CollectionExists(TestConstants.TfsCollectionName)) { teamProjectCollections.CreateProjectCollection(TestConstants.TfsCollectionName, TestConstants.TfsCollectionDescription); } } using (ITeamProjects teamProjectCollections = TeamProjectFactory.CreateTeamProjectMananger(TestConstants.TfsCollectionUri, TestConstants.DefaultCredentials)) { if (!teamProjectCollections.TeamProjectExists(TestConstants.TfsTeamProjectName)) { string processName = string.Empty; IProcessTemplates processTemplates = ProcessTemplateFactory.CreateProcessTemplateMananger(TestConstants.TfsCollectionUri); processName = processTemplates.ListProcessTemplates()[0].Name; if (!teamProjectCollections.CreateTeamProject(TestConstants.TfsTeamProjectName, TestConstants.TfsTeamProjectDescription, processName, false, false)) { throw new Exception("Failed to create the default project for TFS API Tests."); } } } }
public static void Refresh() { //Administration AreaManagerFactory.Reset(); GlobalListFactory.Reset(); IterationManagerFactory.Reset(); ProcessTemplateFactory.Reset(); TeamManagerFactory.Reset(); TeamProjectFactory.Reset(); TfsTeamProjectCollectionFactory.Reset(); TeamProjectCollectionFactory.Reset(); //Queries QueryRunnerFactory.Reset(); //TestManagement TestCaseFactory.Reset(); TestCaseStepFactory.Reset(); TestSuiteFactory.Reset(); TestSuiteManagerFactory.Reset(); //WorkItemTracking WorkItemStoreFactory.Reset(); }