public GetAllWebhooksTests() { HipchatApiConfig.AuthToken = TestsConfig.AuthToken; _client = new HipchatClient(); var room = _client.CreateRoom("Test Webhooks Room"); _existingRoomId = room.Id; }
public void CanCreateRoom() { IHipchatClient client = new HipchatClient(); var result = client.CreateRoom(RoomName); Assert.NotNull(result); Assert.NotNull(result.Links); Assert.NotNull(result.Links.Self); }
public void CanDeleteRoom() { const string testRoomName = "Delete Me"; var client = new HipchatClient(); client.CreateRoom(testRoomName); var result = client.DeleteRoom(testRoomName); Assert.True(result); }
public UpdateRoomTests() { HipchatApiConfig.AuthToken = TestsConfig.AuthToken; _client = new HipchatClient(); var room = _client.CreateRoom("TestUpdateRoom"); _createdRoomId = room.Id; var getRoomResponse = _client.GetRoom(_createdRoomId); _owner = getRoomResponse.Owner; }
public GetRoomTests() { const string roomName = "Test GetRooms"; HipchatApiConfig.AuthToken = TestsConfig.AuthToken; _client = new HipchatClient(); var room = _client.CreateRoom(roomName); _existingRoomId = room.Id; _existingRoomName = "Test GetRooms"; }
public static int GetARoomId(HipchatClient client, string roomName) { try { var room = client.GetRoom(roomName); return(room.Id); } catch (HipchatRoomNotFoundException) { var room = client.CreateRoom(roomName); return(room.Id); } }
public ViewRoomHistoryTests() { const string roomName = "Test ViewRoomHistory"; HipchatApiConfig.AuthToken = TestsConfig.AuthToken; _client = new HipchatClient(); var room = _client.CreateRoom(roomName); _existingRoomId = room.Id; _existingRoomName = "Test ViewRoomHistory"; // Add notifications to history _client.SendNotification(_existingRoomId, "First entry to history"); _client.ShareFileWithRoom(_existingRoomId.ToString(), @"..\..\Data\RUv8sSn.png", "Second entry to history with file"); }
public GetAllWebhooksTests() { HipchatApiConfig.AuthToken = TestsConfig.AuthToken; _client = new HipchatClient(); try { var existingRoom = _client.GetRoom("Test Webhooks Room"); _existingRoomId = existingRoom.Id; } catch (Exception) { var room = _client.CreateRoom("Test Webhooks Room"); _existingRoomId = room.Id; } }
public static void SendNotification(string roomName, string message, RoomColors color) { retry: try { _hipchat.SendNotification(roomName, message, color); } catch (HipchatWebException e) { if (e.Message.Contains("Room not found")) { _hipchat.CreateRoom(roomName, false, null, RoomPrivacy.Private); } if (e.Message.Contains("rate")) { return; } goto retry; } catch (Exception e) { LogTo.Error("Hipchat error: {0}- {1}\r\n{2}", e.GetType().ToString(), e.Message, e.StackTrace); } }
public SendRoomNotification() { HipchatApiConfig.AuthToken = TestsConfig.AuthToken; _client = new HipchatClient(); _existingRoomId = _client.CreateRoom("Send Notification Test Room").Id; }