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


C# ProjectRequest.ToString方法代碼示例

本文整理匯總了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);
 }
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:11,代碼來源:ProjectRequestTests.cs

示例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");
        }
開發者ID:kyght,項目名稱:CruiseControl.NET,代碼行數:15,代碼來源:CruiseServerClientTests.cs

示例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();
        }
開發者ID:kyght,項目名稱:CruiseControl.NET,代碼行數:18,代碼來源:CruiseServerClientTests.cs

示例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);
 }
開發者ID:kascomp,項目名稱:CruiseControl.NET,代碼行數:20,代碼來源:ProjectRequestTests.cs


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