本文整理匯總了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);
}