本文整理汇总了C#中ThoughtWorks.CruiseControl.Remote.Messages.ProjectRequest.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectRequest.ToString方法的具体用法?C# ProjectRequest.ToString怎么用?C# ProjectRequest.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThoughtWorks.CruiseControl.Remote.Messages.ProjectRequest
的用法示例。
在下文中一共展示了ProjectRequest.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToStringSerialisesDefaultValues
public void ToStringSerialisesDefaultValues()
{
ProjectRequest request = new ProjectRequest();
string actual = request.ToString();
string expected = string.Format(System.Globalization.CultureInfo.CurrentCulture,"<projectMessage xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"timestamp=\"{2:yyyy-MM-ddTHH:mm:ss.FFFFFFFzzz}\" identifier=\"{0}\" source=\"{1}\" />",
request.Identifier,
request.SourceName,
request.Timestamp);
Assert.AreEqual(expected, actual);
}
示例2: ProcessMessageCorrectlyHandlesAnUnknownAction
public void ProcessMessageCorrectlyHandlesAnUnknownAction()
{
// Setup the messages
ProjectRequest request = new ProjectRequest("123-45", "A test project");
// Initialises the mocks
ICruiseServer server = mocks.DynamicMock<ICruiseServer>();
mocks.ReplayAll();
// Run the actual test
var manager = new ThoughtWorks.CruiseControl.Core.CruiseServerClient(server);
string responseText = manager.ProcessMessage("UnknownAction", request.ToString());
Response response = ConvertXmlToResponse(responseText);
Assert.AreEqual(ResponseResult.Failure, response.Result, "Result is unexpected");
}
示例3: ProcessMessageCorrectlyHandlesAValidMessage
public void ProcessMessageCorrectlyHandlesAValidMessage()
{
// Setup the messages
ProjectRequest request = new ProjectRequest("123-45", "A test project");
Response response = new Response(request);
response.Result = ResponseResult.Success;
// Initialises the mocks
ICruiseServer server = mocks.DynamicMock<ICruiseServer>();
Expect.Call(server.ForceBuild(request)).Return(response);
mocks.ReplayAll();
// Run the actual test
var manager = new ThoughtWorks.CruiseControl.Core.CruiseServerClient(server);
string responseText = manager.ProcessMessage("ForceBuild", request.ToString());
Assert.AreEqual(response.ToString(), responseText);
mocks.VerifyAll();
}
示例4: ToStringSerialisesAllValues
public void ToStringSerialisesAllValues()
{
ProjectRequest request = new ProjectRequest();
request.Identifier = "identifier";
request.ProjectName = "projectName";
request.ServerName = "serverName";
request.SessionToken = "sessionToken";
request.SourceName = "sourceName";
request.Timestamp = DateTime.Now;
string actual = request.ToString();
string expected = string.Format(System.Globalization.CultureInfo.CurrentCulture,"<projectMessage xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"timestamp=\"{4:yyyy-MM-ddTHH:mm:ss.FFFFFFFzzz}\" identifier=\"{0}\" server=\"{1}\" source=\"{2}\" session=\"{3}\" project=\"{5}\" />",
request.Identifier,
request.ServerName,
request.SourceName,
request.SessionToken,
request.Timestamp,
request.ProjectName);
Assert.AreEqual(expected, actual);
}