Пример #1
0
		public void TrimBaseFromFilePath_WithBaseNoTrailingSlash_ExcludesBasePath()
		{
			var task = new Archive();
			task.BasePath = "/trim/this/path";
			var result = task.TrimBaseFromFilePath("/trim/this/path/myproject/here");
			Assert.AreEqual("myproject/here", result);
		}
Пример #2
0
		public void Arguments_ForUnknown_EmptyString()
		{
			var task = new Archive();
			task.Command = "Unknown";
			task.OutputFileName = "MyOutputFile.tar.gz";
			Assert.AreEqual(String.Empty, task.Arguments());
		}
Пример #3
0
		public void Arguments_ForTar_CorrectAndIncludeFileName()
		{
			var task = new Archive();
			task.Command = "Tar";
			task.OutputFileName = "MyOutputFile.tar.gz";
			Assert.AreEqual("-cvzf MyOutputFile.tar.gz", task.Arguments());
		}
Пример #4
0
		public void FlattenFilePaths_TwoItemsOneWithSpace_TrimsAndQuotesStringCorrect()
		{
			using (var e = new EnvironmentForTest())
			{
				var task = new Archive();
				task.BasePath = e.BasePath;
				task.InputFilePaths = e.TwoItemsWithBasePath("a space.cs", "b.cs");
				var result = task.FlattenFilePaths(task.InputFilePaths, ' ', false);
				Assert.AreEqual("\"a space.cs\" b.cs", result);
			}
		}
Пример #5
0
		public void ExecutableName_ForUnknown_EmptyString()
		{
			var task = new Archive();
			task.Command = "Unknown";
			Assert.AreEqual(String.Empty, task.ExecutableName());
		}
Пример #6
0
		public void ExecutableName_ForTar_Tar()
		{
			var task = new Archive();
			task.Command = "Tar";
			Assert.AreEqual("tar", task.ExecutableName());
		}