本文整理汇总了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");
}
示例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);
}
示例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");
}
示例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) { }
}