当前位置: 首页>>代码示例>>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;未经允许,请勿转载。