示例#1
0
        public void CopyRepository_DirectoryAlreadyExists_AllFilesSuccessfullyCopied()
        {
            // Arrange
            string targetPath    = TestDataHelper.CreateEmptyDirectory("cloneDirectory");
            var    gitRepository = GetTestRepository("ttd", "hvem-er-hvem", "testUser");

            try
            {
                // Act
                gitRepository.CopyRepository(targetPath);
                int actualFileCount = Directory.GetFiles(targetPath, "*", SearchOption.AllDirectories).Length;

                // Assert
                int expectedFileCount = Directory.GetFiles(gitRepository.RepositoryDirectory, "*", SearchOption.AllDirectories).Length;

                Assert.Equal(expectedFileCount, actualFileCount);
            }
            finally
            {
                Directory.Delete(targetPath, true);
            }
        }