示例#1
0
		public void PopulateFromFullySpecifiedXml()
		{
			const string xml = @"
<git>
	<executable>git</executable>
	<repository>c:\git\ccnet\mygitrepo</repository>
	<branch>master</branch>
	<timeout>5</timeout>
	<workingDirectory>c:\git\working</workingDirectory>
	<tagOnSuccess>true</tagOnSuccess>
	<commitBuildModifications>true</commitBuildModifications>
	<commitUntrackedFiles>true</commitUntrackedFiles>
	<autoGetSource>true</autoGetSource>
	<tagCommitMessage>CCNet Test Build {0}</tagCommitMessage>
	<tagNameFormat>{0}</tagNameFormat>
	<committerName>Max Mustermann</committerName>
	<committerEMail>[email protected]</committerEMail>
</git>";

			git = (Git)NetReflector.Read(xml);
			Assert.AreEqual("git", git.Executable, "#B1");
			Assert.AreEqual(@"c:\git\ccnet\mygitrepo", git.Repository, "#B2");
			Assert.AreEqual("master", git.Branch, "#B3");
			Assert.AreEqual(new Timeout(5), git.Timeout, "#B4");
			Assert.AreEqual(@"c:\git\working", git.WorkingDirectory, "#B5");
			Assert.AreEqual(true, git.TagOnSuccess, "#B6");
			Assert.AreEqual(true, git.AutoGetSource, "#B7");
			Assert.AreEqual("CCNet Test Build {0}", git.TagCommitMessage, "#B8");
			Assert.AreEqual("{0}", git.TagNameFormat, "#B9");
			Assert.AreEqual("Max Mustermann", git.CommitterName, "#B10");
			Assert.AreEqual("*****@*****.**", git.CommitterEMail, "#B11");
			Assert.AreEqual(true, git.CommitBuildModifications, "#B12");
			Assert.AreEqual(true, git.CommitUntrackedFiles, "#B13");
		}
示例#2
0
		public void PopulateFromMinimallySpecifiedXml()
		{
			const string xml = @"
<git>
    <repository>c:\git\ccnet\mygitrepo</repository>
</git>";
			git = (Git)NetReflector.Read(xml);
			Assert.AreEqual(@"git", git.Executable, "#C1");
			Assert.AreEqual(@"c:\git\ccnet\mygitrepo", git.Repository, "#C2");
			Assert.AreEqual(@"master", git.Branch, "#C3");
			Assert.AreEqual(new Timeout(600000), git.Timeout, "#C4");
			Assert.AreEqual(null, git.WorkingDirectory, "#C5");
			Assert.AreEqual(false, git.TagOnSuccess, "#C6");
			Assert.AreEqual(true, git.AutoGetSource, "#C7");
			Assert.AreEqual("CCNet Build {0}", git.TagCommitMessage, "#C8");
			Assert.AreEqual("CCNet-Build-{0}", git.TagNameFormat, "#C9");
			Assert.AreEqual(null, git.CommitterName, "#C10");
			Assert.AreEqual(null, git.CommitterEMail, "#C11");
			Assert.AreEqual(false, git.CommitBuildModifications, "#C12");
			Assert.AreEqual(false, git.CommitUntrackedFiles, "#C13");
		}
示例#3
0
		private void SetupGit(IFileSystem filesystem, IFileDirectoryDeleter fileDirectoryDeleter)
		{
			git = new Git((IHistoryParser)mockHistoryParser.MockInstance, (ProcessExecutor)mockProcessExecutor.MockInstance, filesystem, fileDirectoryDeleter);
			git.Repository = @"xyz.git";
			git.WorkingDirectory = DefaultWorkingDirectory;
		}