public void TestBuildRepositories() { _deploymentService.ReadConfigurationFromFile(); _deploymentService.CheckRepositoriesForUpdates(); _deploymentService.UpdateRepositories(); Assert.AreEqual(_deploymentService.RepositoriesToDeploy.Count(), 0, "There are repositories needing to be deployed before building repositories, which should never happen."); bool result = _deploymentService.BuildRepositories(); Assert.IsTrue(result, "Function that builds repositories returned false when true was expected."); Assert.Greater(_deploymentService.RepositoriesToDeploy.Count(), 0, "No repositories have been reported as needing to be deployed after building repositories, when there should've been at least one."); }
/// <summary> /// Builds the repositories that have been recently updated. /// </summary> /// <returns> /// <c>true</c> if all repositories were built successfully; <c>false</c> if at least one repository failed to build. /// </returns> /// <seealso cref="UpdateRepositories" /> /// <seealso cref="RepositoriesToBuild" /> /// <seealso cref="RepositoriesToDeploy" /> /// <remarks> /// This method will not update the local repositories from their remote origins. To do so, call <see cref="UpdateRepositories" />. /// The list of repositories that will be built by this method is available through <see cref="RepositoriesToBuild" />. /// Once built the repositories will be made available for deployment. See the list of repositories available for deployment on <see cref="RepositoriesToDeploy" />. /// </remarks> public bool BuildRepositories() { bool result = false; if (_repositoryService != null) { result = _repositoryService.BuildRepositories(); } else { // TODO: Log that repository service is not present. } return(result); }