当前位置: 首页>>代码示例>>C#>>正文


C# Project.Update方法代码示例

本文整理汇总了C#中Project.Update方法的典型用法代码示例。如果您正苦于以下问题:C# Project.Update方法的具体用法?C# Project.Update怎么用?C# Project.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Project的用法示例。


在下文中一共展示了Project.Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RunPropertyChangedTest

        private void RunPropertyChangedTest(string property, object originalValue, object newValue)
        {
            mocks = new MockRepository();
            var client = mocks.DynamicMock<CruiseServerClientBase>();
            var server = InitialiseServer();
            var statusType = typeof(ProjectStatus);
            var propertyMember = statusType.GetProperty(property);

            var status = new ProjectStatus();
            propertyMember.SetValue(status, originalValue, new object[0]);
            var project = new Project(client, server, status);
            mocks.ReplayAll();
            var eventFired = false;

            var newStatus = new ProjectStatus();
            propertyMember.SetValue(newStatus, newValue, new object[0]);
            project.PropertyChanged += (o, e) =>
            {
                if (e.PropertyName == property) eventFired = true;
            };
            project.Update(newStatus);
            Assert.IsTrue(eventFired, "PropertyChanged for " + property + " change not fired");
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:23,代码来源:ProjectTests.cs

示例2: UpdateChangesUnderlyingStatus

        public void UpdateChangesUnderlyingStatus()
        {
            var client = mocks.DynamicMock<CruiseServerClientBase>();
            var server = InitialiseServer();
            var status = new ProjectStatus { BuildStatus = IntegrationStatus.Exception };
            var project = new Project(client, server, status);
            mocks.ReplayAll();

            var newStatus = new ProjectStatus { BuildStatus = IntegrationStatus.Failure };
            project.Update(newStatus);
            Assert.AreEqual(newStatus.BuildStatus, project.BuildStatus);
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:12,代码来源:ProjectTests.cs

示例3: UpdateFiresPropertyChangedWhenMessageIsChanged

        public void UpdateFiresPropertyChangedWhenMessageIsChanged()
        {
            mocks = new MockRepository();
            var client = mocks.DynamicMock<CruiseServerClientBase>();
            var server = InitialiseServer();
            var status = new ProjectStatus
            {
                Messages = new Message[] {
                    new Message{Text = "Message 1"}
                }
            };
            var project = new Project(client, server, status);
            mocks.ReplayAll();
            var eventFired = false;

            var newStatus = new ProjectStatus
            {
                Messages = new Message[] {
                    new Message{Text = "Message 2"}
                }
            };
            project.PropertyChanged += (o, e) =>
            {
                if (e.PropertyName == "Messages") eventFired = true;
            };
            project.Update(newStatus);
            Assert.IsTrue(eventFired, "PropertyChanged for Messages change not fired");
        }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:28,代码来源:ProjectTests.cs

示例4: UpdateValidatesArguments

 public void UpdateValidatesArguments()
 {
     var client = mocks.DynamicMock<CruiseServerClientBase>();
     var server = InitialiseServer();
     var status = new ProjectStatus { BuildStatus = IntegrationStatus.Exception };
     var project = new Project(client, server, status);
     mocks.ReplayAll();
     try
     {
         project.Update(null);
         Assert.Fail("ArgumentNullException was expected");
     }
     catch (ArgumentNullException) { }
 }
开发者ID:kascomp,项目名称:CruiseControl.NET,代码行数:14,代码来源:ProjectTests.cs


注:本文中的Project.Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。