예제 #1
0
        public void CreateTeamProject_PassInTestProjectDetailsWithExistingProjectName_ArgumentExceptionThrown()
        {
            // arrange
            ITeamProjects teamProjects = TeamProjectFactory.CreateTeamProjectMananger(TestConstants.TfsCollectionUri);
            string        projectName  = TestConstants.TfsTeamProjectName;

            IProcessTemplates processTemplates    = ProcessTemplateFactory.CreateProcessTemplateMananger(TestConstants.TfsCollectionUri);
            string            processTemplateName = processTemplates.ListProcessTemplates()[0].Name;

            // act
            teamProjects.CreateTeamProject(projectName, projectName + " Description", processTemplateName, false, false);

            // assert
            bool actual = false;

            foreach (string project in teamProjects.ListTeamProjectNames())
            {
                if (string.Compare(project, projectName, true) == 0)
                {
                    actual = true;
                    break;
                }
            }

            Assert.IsTrue(actual);
        }
예제 #2
0
        public void CreateAndDeleteTeamProject_PassInTestProjectDetails_ProjectListToReturnTheNewProjectInTheListAndThenTheProjectToBeRemovedAndVerifyTheWarnings()
        {
            // arrange
            ITeamProjects teamProjects = TeamProjectFactory.CreateTeamProjectMananger(TestConstants.TfsCollectionUri);
            string        projectName  = TestProjectNameBase + Guid.NewGuid().ToString("N");

            IProcessTemplates processTemplates    = ProcessTemplateFactory.CreateProcessTemplateMananger(TestConstants.TfsCollectionUri);
            string            processTemplateName = processTemplates.ListProcessTemplates()[0].Name;

            // act
            teamProjects.CreateTeamProject(projectName, projectName + " Description", processTemplateName, false, false);

            // assert
            bool actual = false;

            foreach (string project in teamProjects.ListTeamProjectNames())
            {
                if (string.Compare(project, projectName, true) == 0)
                {
                    actual = true;
                    break;
                }
            }

            Assert.IsTrue(actual, "Create Failed.");
            List <Exception> exceptions;

            teamProjects.DeleteTeamProject(projectName, out exceptions, true, false);

            bool actualAfter = false;

            foreach (string project in teamProjects.ListTeamProjectNames())
            {
                if (string.Compare(project, projectName, true) == 0)
                {
                    actualAfter = true;
                    break;
                }
            }

            Assert.IsFalse(actualAfter, "Delete Failed.");
        }
예제 #3
0
        public void ListTeamProjectNames_Defaults_ReturnAIEnumerableOfString()
        {
            // arrange
            ITeamProjects teamProjects = TeamProjectFactory.CreateTeamProjectMananger(TestConstants.TfsCollectionUri);

            // act
            object actual = teamProjects.ListTeamProjectNames();

            // assert
            Assert.IsInstanceOfType(actual, typeof(IEnumerable <string>));
        }
예제 #4
0
        public void ClassCleanup()
        {
            ITeamProjects teamProjects = TeamProjectFactory.CreateTeamProjectMananger(TestConstants.TfsCollectionUri);

            foreach (string projectName in teamProjects.ListTeamProjectNames())
            {
                if (projectName.StartsWith(TestProjectNameBase))
                {
                    teamProjects.DeleteTeamProject(projectName, true, false);
                }
            }
        }
예제 #5
0
        public void ListTeamProjectNames_Defaults_ReturnAIEnumerableOfStringContainingMoreThan0ProjectNames()
        {
            // arrange
            ITeamProjects teamProjects = TeamProjectFactory.CreateTeamProjectMananger(TestConstants.TfsCollectionUri);

            // act
            IEnumerable <string> projects = teamProjects.ListTeamProjectNames();

            // assert
            bool actual = false;

            foreach (string project in projects)
            {
                actual = true;
                break;
            }

            Assert.IsTrue(actual);
        }