public void ToStringSerialisesAllValues()
 {
     MessageRequest request = new MessageRequest();
     request.Identifier = "identifier";
     request.ProjectName = "projectName";
     request.ServerName = "serverName";
     request.SessionToken = "sessionToken";
     request.SourceName = "sourceName";
     request.Timestamp = DateTime.Now;
     request.Message = "message";
     string actual = request.ToString();
     string expected = string.Format(System.Globalization.CultureInfo.CurrentCulture,"<messageMessage 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}\">" + 
         "<message>{6}</message>" +
         "<kind>NotDefined</kind>" +
         "</messageMessage>",
         request.Identifier,
         request.ServerName,
         request.SourceName,
         request.SessionToken,
         request.Timestamp,
         request.ProjectName,
         request.Message);
     Assert.AreEqual(expected, actual);
 }
 public void ToStringSerialisesDefaultValues()
 {
     MessageRequest request = new MessageRequest();
     string actual = request.ToString();
     string expected = string.Format(System.Globalization.CultureInfo.CurrentCulture,"<messageMessage 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}\">{3}</messageMessage>",
         request.Identifier,
         request.SourceName,
         request.Timestamp,
         "<kind>NotDefined</kind>");
     Assert.AreEqual(expected, actual);
 }
        /// <summary>
        /// Sends a message for a project.
        /// </summary>
        /// <param name="projectName">The name of the project to use.</param>
        /// <param name="message"></param>
        public override void SendMessage(string projectName, Message message)
        {
            if (string.IsNullOrEmpty(projectName)) throw new ArgumentNullException("projectName");

            MessageRequest request = new MessageRequest();
            request.SessionToken = SessionToken;
            request.ProjectName = projectName;
            request.Message = message.Text;
            request.Kind = message.Kind;
            request.ServerName = TargetServer;
            Response resp = connection.SendMessage("SendMessage", request);
            ValidateResponse(resp);
        }
 /// <summary>
 /// Send a text message to the server.
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public Response SendMessage(MessageRequest request)
 {
     return cruiseServer.SendMessage(request);
 }
        /// <summary>
        /// Sends the message.	
        /// </summary>
        /// <param name="projectName">Name of the project.</param>
        /// <param name="message">The message.</param>
        /// <remarks></remarks>
		public void SendMessage(string projectName, Message message)
		{
            MessageRequest request = new MessageRequest();
            request.ProjectName = projectName;
            request.Message = message.Text;
            request.Kind = message.Kind;
            Response resp = cruiseServer.SendMessage(request);
            ValidateResponse(resp);
        }
 /// <summary>
 /// Send a text message to the server.
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public virtual Response SendMessage(MessageRequest request)
 {
     Response response = RunProjectRequest(request,
         SecurityPermission.SendMessage,
         SecurityEvent.SendMessage,
         delegate(ProjectRequest arg, Response resp)
         {
             // Perform the actual send message
             Log.Info("New message received: " + request.Message);
             Message message = new Message(request.Message, request.Kind);
             if (!FireSendMessageReceived(arg.ProjectName, message))
             {
                 LookupProject(arg.ProjectName).AddMessage(message);
                 FireSendMessageProcessed(arg.ProjectName, message);
             }
         });
     return response;
 }
 public void GetSetAllPropertiesWorks()
 {
     MessageRequest request = new MessageRequest();
     request.Message = "new message";
     Assert.AreEqual("new message", request.Message, "Message fails the get/set test");
 }
 /// <summary>
 /// Send a text message to the server.
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public virtual Response SendMessage(MessageRequest request)
 {
     return server.SendMessage(request);
 }