當前位置: 首頁>>代碼示例>>C#>>正文


C# Core.Modification類代碼示例

本文整理匯總了C#中ThoughtWorks.CruiseControl.Core.Modification的典型用法代碼示例。如果您正苦於以下問題:C# Modification類的具體用法?C# Modification怎麽用?C# Modification使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Modification類屬於ThoughtWorks.CruiseControl.Core命名空間,在下文中一共展示了Modification類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetupModification

 public void SetupModification(Modification[] modifications)
 {
     foreach (Modification mod in modifications)
     {
         mod.Url = String.Format(_url, mod.FolderName.Length == 0 ? mod.FileName : mod.FolderName + "/" + mod.FileName);
     }
 }
開發者ID:vardars,項目名稱:ci-factory,代碼行數:7,代碼來源:ViewCVSUrlBuilder.cs

示例2: Parse

        public Modification[] Parse(TextReader history, DateTime from, DateTime to)
        {
            var modifications = new List<Modification>();
            var document = XDocument.Load(history);
            var fromDate = from.ToString("s");
            var toDate = to.ToString("s");
            foreach (XElement change in document.Descendants("change"))
            {
                var date = DateTime.Parse(
                    change.Attribute("date").Value);
                if ((date >= from) &&
                    (date <= to))
                {
                    var modification = new Modification
                    {
                        FileName = change.Attribute("file").Value,
                        ModifiedTime = date,
                        FolderName = change.Attribute("folder").Value,
                        Type = change.Attribute("type").Value
                    };
                    modifications.Add(modification);
                }
            }

            return modifications.ToArray();
        }
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:26,代碼來源:IndexFileHistoryParser.cs

示例3: ShouldNotAcceptModificationsWithNullFolder

		public void ShouldNotAcceptModificationsWithNullFolder()
		{
			Modification modification = new Modification();
			PathFilter filter = new PathFilter();
			filter.Pattern = "*.*";
			Assert.IsFalse(filter.Accept(modification));
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:7,代碼來源:PathFilterTest.cs

示例4: ShouldCheckModificationsUntilThereAreNoModsInModificationDelay

		public void ShouldCheckModificationsUntilThereAreNoModsInModificationDelay()
		{
			quietPeriod.ModificationDelaySeconds = 45;		

			// last build was at 12:01:00, current build is at 12:02:00
			
			// with a modification just at 12:01:30...
			Modification[] newMods = new Modification[] { CreateModificationAtTime(12, 01, 30) };
			
			// ...should wait for 15 seconds so that the 45 second delay completes (at 12:02:15)
			mockSourceControl.ExpectAndReturn("GetModifications", newMods, lastBuild, thisBuild);
			mockDateTimeProvider.Expect("Sleep", TimeSpan.FromSeconds(15));
			mockDateTimeProvider.ExpectAndReturn("Now", CreateDateTime(12, 02, 15));

			// After this time it should ask for modifications again.  Introduce a new modification at 12:02:10, meaning that the ealiest a build can start is at 12:02:55
			//  i.e. 40 seconds from the time of the current build (12:02:15)
			newMods = new Modification[] {newMods[0], CreateModificationAtTime(12, 02, 10)};		
			mockSourceControl.ExpectAndReturn("GetModifications", newMods, lastBuild, IntegrationResultMother.CreateSuccessful(CreateDateTime(12, 02, 15)));
			mockDateTimeProvider.Expect("Sleep", TimeSpan.FromSeconds(40));
			mockDateTimeProvider.ExpectAndReturn("Now", CreateDateTime(12, 02, 55));
			mockSourceControl.ExpectAndReturn("GetModifications", newMods, lastBuild, IntegrationResultMother.CreateSuccessful(CreateDateTime(12, 02, 55)));

			Modification[] actualMods = quietPeriod.GetModifications((ISourceControl) mockSourceControl.MockInstance, lastBuild, thisBuild);

			Assert.AreEqual(newMods, actualMods);
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:26,代碼來源:QuietPeriodTest.cs

示例5: ShouldRejectModificationsWithNullComments

		public void ShouldRejectModificationsWithNullComments()
		{
			Modification modification = new Modification();
            CommentFilter filter = new CommentFilter();
			filter.Pattern = ".*";
			Assert.IsFalse(filter.Accept(modification), "Should not have matched but did.");
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:7,代碼來源:CommentFilterTest.cs

示例6: ShouldFilterSpecifiedAction

		public void ShouldFilterSpecifiedAction()
		{
			Modification mod = new Modification();
			mod.Type = "Created";

			filter.Actions = new string[] {"Created"};
			Assert.IsTrue(filter.Accept(mod), "Action not filtered");
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:8,代碼來源:ActionFilterTest.cs

示例7: ShouldFilterSpecifiedUser

		public void ShouldFilterSpecifiedUser()
		{
			Modification mod = new Modification();
			mod.UserName = "bob";

			filter.UserNames = new string[] { "bob" };
			Assert.IsTrue(filter.Accept(mod));
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:8,代碼來源:UserFilterTest.cs

示例8: ShouldRejectModificationsWithMatchingComments

 public void ShouldRejectModificationsWithMatchingComments()
 {
     Modification modification = new Modification();
     modification.Comment = "This is a comment.";
     CommentFilter filter = new CommentFilter();
     filter.Pattern = ".* is not a .*";
     Assert.IsFalse(filter.Accept(modification), "Should not have matched but did.");
 }
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:8,代碼來源:CommentFilterTest.cs

示例9: GetModificationsDoesNotCreateLabelWhenThereAreNoModifications

		public void GetModificationsDoesNotCreateLabelWhenThereAreNoModifications()
		{
			ProcessResult result = new ProcessResult("",string.Empty, 0, false);
			Modification[] emptyArray = new Modification[0];
			_historyParser.SetupResult("Parse", emptyArray, typeof(TextReader), typeof(DateTime), typeof(DateTime));
			_executor.ExpectAndReturn("Execute", result, new IsTypeOf(typeof(ProcessInfo)));
			_executor.ExpectNoCall("Execute", typeof(ProcessInfo));

			_vss.GetModifications(IntegrationResultMother.CreateSuccessful(DateTime.Now), IntegrationResultMother.CreateSuccessful(DateTime.Now));
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:10,代碼來源:VssApplyLabelTest.cs

示例10: ParseUsernameAndUKDate

		public void ParseUsernameAndUKDate()
		{
			Modification mod = new Modification();
			string line = "foo\r\nUser: Admin        Date:  16/9/02   Time:  22:40\r\n";
            CheckInParser myParser = new CheckInParser(line, new VssLocale(new CultureInfo("en-GB")));
            myParser.ParseUsernameAndDate(mod);

			Assert.AreEqual("Admin", mod.UserName);
			Assert.AreEqual(new DateTime(2002, 9, 16, 22, 40, 0), mod.ModifiedTime);
		}
開發者ID:aravindmc,項目名稱:CruiseControl.NET,代碼行數:10,代碼來源:VssHistoryParserTest.cs

示例11: CanAssignFileInfoWithNoPath

		public void CanAssignFileInfoWithNoPath()
		{
			const string file = "context.js";
			Modification modification = new Modification();

			parser.AssignFileInfo( modification, file );

			Assert.AreEqual( string.Empty, modification.FolderName );
			Assert.AreEqual( file, modification.FileName );
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:10,代碼來源:ClearCaseHistoryParserTest.cs

示例12: AccuRevMotherWindows

        public AccuRevMotherWindows()
        {
            historyOutputReader = new StringReader(historyOutputDataWindows);

            /// The date ranges.
            oldestHistoryModification = DateTime.Parse("2006/11/22 11:10:44");
            newestHistoryModification = DateTime.Parse("2006/11/22 11:11:00");

            historyOutputModifications = new Modification[5];

            historyOutputModifications[0] = new Modification();
            historyOutputModifications[0].ChangeNumber = "12245";
            historyOutputModifications[0].Comment = "New Project for accessing SICS/nt web services";
            historyOutputModifications[0].FileName = "AssemblyInfo.cs";
            historyOutputModifications[0].FolderName = @"Dev\Server\Interface\Properties\";
            historyOutputModifications[0].ModifiedTime = new DateTime(2006,11,22,11,11,00);
            historyOutputModifications[0].Type = "add";
            historyOutputModifications[0].UserName = "joe_user";

            historyOutputModifications[1] = new Modification();
            historyOutputModifications[1].ChangeNumber = "12244";
            historyOutputModifications[1].Comment = "New Project for accessing web services";
            historyOutputModifications[1].FileName = "Interface";
            historyOutputModifications[1].FolderName = @"Dev\Server\";
            historyOutputModifications[1].ModifiedTime = new DateTime(2006,11,22,11,10,44);
            historyOutputModifications[1].Type = "add";
            historyOutputModifications[1].UserName = "sam_spade";

            historyOutputModifications[2] = new Modification();
            historyOutputModifications[2].ChangeNumber = "12244";
            historyOutputModifications[2].Comment = "New Project for accessing web services";
            historyOutputModifications[2].FileName = "App.config";
            historyOutputModifications[2].FolderName = @"Dev\Server\Interface\";
            historyOutputModifications[2].ModifiedTime = new DateTime(2006, 11, 22, 11, 10, 44);
            historyOutputModifications[2].Type = "add";
            historyOutputModifications[2].UserName = "sam_spade";

            historyOutputModifications[3] = new Modification();
            historyOutputModifications[3].ChangeNumber = "12244";
            historyOutputModifications[3].Comment = "New Project for accessing web services";
            historyOutputModifications[3].FileName = "CommonTypes.cs";
            historyOutputModifications[3].FolderName = @"Dev\Server\Interface\";
            historyOutputModifications[3].ModifiedTime = new DateTime(2006, 11, 22, 11, 10, 44);
            historyOutputModifications[3].Type = "add";
            historyOutputModifications[3].UserName = "sam_spade";

            historyOutputModifications[4] = new Modification();
            historyOutputModifications[4].ChangeNumber = "12244";
            historyOutputModifications[4].Comment = "New Project for accessing web services";
            historyOutputModifications[4].FileName = "Connection.cs";
            historyOutputModifications[4].FolderName = @"Dev\Server\Interface\";
            historyOutputModifications[4].ModifiedTime = new DateTime(2006, 11, 22, 11, 10, 44);
            historyOutputModifications[4].Type = "add";
            historyOutputModifications[4].UserName = "sam_spade";
        }
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:55,代碼來源:AccuRevMother.cs

示例13: ShouldBuildValidUrls

		public void ShouldBuildValidUrls()
		{
			HgWebUrlBuilder hgweb = new HgWebUrlBuilder();
			hgweb.Url = "http://selenic.com/hg/index.cgi/";
			Modification[] modifications = new Modification[] {new Modification()};
			modifications[0].Version = "4a064e1977f8";
			hgweb.SetupModification(modifications);

			Assert.That(modifications[0].Url, Is.Not.Null);
			Assert.That(modifications[0].Url, Is.EqualTo("http://selenic.com/hg/index.cgi/rev/4a064e1977f8"));
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:11,代碼來源:HgWebUrlBuilderTest.cs

示例14: CreateModifications

		protected Modification[] CreateModifications()
		{
			Modification[] testModifications = new Modification[]
				{
					new Modification(), new Modification(), new Modification()
				};
			testModifications[0].ChangeNumber = "100";
			testModifications[1].ChangeNumber = "2000";
			testModifications[2].ChangeNumber = "30000";
			return (testModifications);
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:11,代碼來源:ChangeSynergyUrlBuilderTest.cs

示例15: AssertModification

		private void AssertModification(Modification mod, int changeNumber, string revision, string file, string folder, DateTime modifiedTime, string type, string email, string username, string comment)
		{
			Assert.AreEqual(changeNumber.ToString(), mod.ChangeNumber);
			Assert.AreEqual(file, mod.FileName);
			Assert.AreEqual(folder, mod.FolderName);
			Assert.AreEqual(modifiedTime, mod.ModifiedTime);
			Assert.AreEqual(type, mod.Type);
			Assert.AreEqual(email, mod.EmailAddress);
			Assert.AreEqual(username, mod.UserName);
			Assert.AreEqual(comment, mod.Comment);
			Assert.AreEqual(revision, mod.Version);
		}
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:12,代碼來源:P4HistoryParserTest.cs


注:本文中的ThoughtWorks.CruiseControl.Core.Modification類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。