コード例 #1
0
        public void CheckInstanceFromFactory()
        {
            // act
            object teamProjectCollections = TeamProjectCollectionFactory.CreateTeamProjectCollectionMananger(TestConstants.TfsUri, TestConstants.DefaultCredentials);

            // assert
            Assert.IsInstanceOfType(teamProjectCollections, typeof(ITeamProjectCollections));
        }
コード例 #2
0
        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);
        }
コード例 #3
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>));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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.");
                    }
                }
            }
        }