コード例 #1
0
        public void ShouldReturn_Correct_WorkingDirectoryPath()
        {
            var service = new DefaultWorkingDirectory();
            var path    = service.GetWorkingDirectoryPath();

            Assert.IsNotNull(path);
            Assert.IsTrue(path.Contains(AppDomain.CurrentDomain.BaseDirectory));
        }
コード例 #2
0
        public void ShouldCopy_ModulesToRuntimeDirectory_Successfully()
        {
            PrepareTestDll();

            var service = new DefaultWorkingDirectory();

            service.RecopyModulesToRuntimeFolder(new FileInfo(ModuleFileName));
            Assert.IsTrue(File.Exists(RuntimeFileName));

            RemoveTestDll();
        }
コード例 #3
0
        public void ShouldReturn_AvailableModules()
        {
            PrepareTestDll();

            var service = new DefaultWorkingDirectory();
            var modules = service.GetAvailableModules();

            Assert.IsNotNull(modules);
            Assert.AreEqual(modules.Count(), 1);
            Assert.AreEqual(modules.First().Name, "test.dll");

            RemoveTestDll();
        }
コード例 #4
0
        public void ShouldCheckoutInsteadOfUpdateIfCVSFoldersDoNotExist()
        {
            var lastDirectorySeparatorIndex = DefaultWorkingDirectory.TrimEnd().TrimEnd(Path.DirectorySeparatorChar).LastIndexOf(Path.DirectorySeparatorChar);
            var checkoutWd  = DefaultWorkingDirectory.Substring(0, lastDirectorySeparatorIndex);
            var checkoutDir = DefaultWorkingDirectory.Substring(lastDirectorySeparatorIndex).Trim(Path.DirectorySeparatorChar);

            ExpectToExecuteArguments(
                string.Format(
                    @"-d :pserver:[email protected]:/cvsroot/ccnet -q checkout -R -P -d {0} ccnet",
                    StringUtil.AutoDoubleQuoteString(checkoutDir)), checkoutWd);

            ExpectCvsDirectoryExists(false);

            cvs.CvsRoot          = ":pserver:[email protected]:/cvsroot/ccnet";
            cvs.Module           = "ccnet";
            cvs.AutoGetSource    = true;
            cvs.WorkingDirectory = DefaultWorkingDirectory;
            cvs.GetSource(IntegrationResult());
        }
コード例 #5
0
        public void ShouldCloneAndDeleteWorkingDirIfGitDirectoryDoesntExist()
        {
            mockFileSystem.ExpectAndReturn("DirectoryExists", true, DefaultWorkingDirectory);
            mockFileSystem.ExpectAndReturn("DirectoryExists", false, Path.Combine(DefaultWorkingDirectory, ".git"));

            ExpectToExecuteArguments(string.Concat(GIT_CLONE, " ", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)), Path.GetDirectoryName(DefaultWorkingDirectory.TrimEnd(Path.DirectorySeparatorChar)));

            ExpectToExecuteArguments("log origin/master --date-order -1 --pretty=format:\"%H\"");

            ExpectToExecuteArguments(GIT_REMOTE_COMMITS);

            git.GetModifications(IntegrationResult(from), IntegrationResult(to));
        }
コード例 #6
0
 private void ExpectCloneAndInitialiseRepository()
 {
     ExpectToExecuteArguments(string.Concat(GIT_CLONE, " ", StringUtil.AutoDoubleQuoteString(DefaultWorkingDirectory)), Path.GetDirectoryName(DefaultWorkingDirectory.TrimEnd(Path.DirectorySeparatorChar)));
     ExpectToExecuteArguments("config --get user.name");
     ExpectToExecuteArguments("config --get user.email");
 }