public SendMessage ( string message ) : void | ||
message | string | The message to send - can contain some HTML and must be valid XHTML. |
return | void |
/// <summary> /// Sends a message to a chat room. /// </summary> public static void SendMessage(string token, int room, string from, string message, bool notify) { // create a local instance of HipChatClient, as then we get the validation var client = new HipChatClient(token, room); client.SendMessage(message, from, notify); }
/// <summary> /// Sends a message to a chat room. /// </summary> public static void SendMessage(string token, string room, string from, string message, bool notify, BackgroundColor color, MessageFormat messageFormat) { // create a local instance of HipChatClient, as then we get the validation var client = new HipChatClient(token, room); client.SendMessage(message, from, notify, color); }
public void TestUserAlertingWithTextFormatMessage() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId.ToString(), HipChatClient.MessageFormat.text); client.SendMessage("@all this is a test message notifing all users in the room", defaultClient.From); }
public static void TestWindsorInstaller(TestContext context) { IWindsorContainer container = new WindsorContainer(); container.Install(new HipChatClientInstaller()); defaultClient = container.Resolve<HipChatClient>("ChatClient"); defaultClient.From += defaultClient.GetHashCode().ToString(); defaultClient.SendMessage("TestWindsorInstaller"); }
public void TestSendMessageTooLongException() { var client = new HipChat.HipChatClient(defaultClient.Token) { AutoTruncate = false }; client.SendMessage(GetReallyLongMessage(MethodBase.GetCurrentMethod().Name, 5000), defaultClient.RoomId, defaultClient.From); }
public void SendNotification(string sourceName, string notification) { var client = new HipChatClient(_authToken, _roomId, sourceName) { Notify = false, Color = HipChatClient.BackgroundColor.random }; client.SendMessage(notification); }
public void TestSendMessageEmptyException() { var client = new HipChat.HipChatClient(defaultClient.Token); client.SendMessage("", defaultClient.RoomId, defaultClient.From); }
public void TestSendMessage_Message_Room_From_Notify() { var client = new HipChat.HipChatClient(defaultClient.Token); client.SendMessage(MethodBase.GetCurrentMethod().Name, defaultClient.RoomId, defaultClient.From, true); }
public void TestSendMessage_Message_From() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId); client.SendMessage(MethodBase.GetCurrentMethod().Name, defaultClient.From); }
public void TestSendMessage_Message_green_notify() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From); client.SendMessage(MethodBase.GetCurrentMethod().Name, HipChatClient.BackgroundColor.green, true); }
public void TestSendMessage_UnicodeAuthorAndMessage() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, "lǝʌɐd ツ"); client.SendMessage(MethodBase.GetCurrentMethod().Name + " ಠ_ಠ"); }
public void TestSendMessage_HtmlMessage() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From); client.SendMessage(MethodBase.GetCurrentMethod().Name + " <a href='http://en.wikiquote.org/wiki/Pulp_Fiction#Dialogue'>Quotable & questionable (?) gems from "Pulp Fiction"</a> =)"); }
public void TestSendMessage_UnicodeAuthorAndMessage() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, "lǝʌɐd ツ"); client.SendMessage(MethodBase.GetCurrentMethod().Name + " ಠ_ಠ"); }
public void Run(IIntegrationResult result) { var displayDuration = false; var duration = TimeSpan.Zero; if (result.EndTime != DateTime.MinValue) { duration = result.EndTime - result.StartTime; displayDuration = true; } var link = String.Format(@"<a href=""{0}"">{1}</a>", result.ProjectUrl, result.Status); var message = new StringBuilder(); message.Append(result.ProjectName); message.Append(" "); if(String.IsNullOrEmpty(Message)) { message.Append("build complete"); } else { message.Append(Message); } message.Append(" "); if(displayDuration) { message.AppendFormat("(duration {0})", duration); } message.Append(". "); if(!HideResult) { message.AppendFormat("Result: {0}.", link); } var notify = result.Succeeded; var color = result.Succeeded ? HipChatClient.BackgroundColor.green : HipChatClient.BackgroundColor.red; if(HideResult) { color = HipChatClient.BackgroundColor.yellow; } var client = new HipChatClient(AuthToken, RoomId, From); client.SendMessage(message.ToString(), color, notify); }
public void TestSendMessage_HtmlMessage() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From); client.SendMessage(MethodBase.GetCurrentMethod().Name + " <a href='http://en.wikiquote.org/wiki/Pulp_Fiction#Dialogue'>Quotable & questionable (?) gems from "Pulp Fiction"</a> =)"); }
public void TestSendMessage_Message() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From); client.SendMessage(MethodBase.GetCurrentMethod().Name); }
public void TestSendMessageTooLongException() { var client = new HipChat.HipChatClient(defaultClient.Token) { AutoTruncate = false }; client.SendMessage(GetReallyLongMessage(MethodBase.GetCurrentMethod().Name, 5000), defaultClient.RoomId, defaultClient.From); }
public void TestSendMessageEmptyException() { var client = new HipChat.HipChatClient(defaultClient.Token); client.SendMessage("", defaultClient.RoomId, defaultClient.From); }
public void TestSendMessage_Message_green_notify() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId, defaultClient.From); client.SendMessage(MethodBase.GetCurrentMethod().Name, HipChatClient.BackgroundColor.green, true); }
/// <summary> /// Sends a message to a chat room. /// </summary> public static void SendMessage(string token, int room, string from, string message, bool notify) { // create a local instance of HipChatClient, as then we get the validation var client = new HipChatClient(token, room); client.SendMessage(message, from, notify); }
/// <summary> /// Sends a message to a chat room. /// </summary> public static void SendMessage(string token, int room, string from, string message, BackgroundColor color) { // create a local instance of HipChatClient, as then we get the validation var client = new HipChatClient(token, room); client.SendMessage(message, from, color); }
public void TestUserAlertingWithTextFormatMessage() { var client = new HipChat.HipChatClient(defaultClient.Token, defaultClient.RoomId.ToString(),HipChatClient.MessageFormat.text); client.SendMessage("@all this is a test message notifing all users in the room", defaultClient.From); }