Skip to content

Commit

Permalink
Made test code more reliable
Browse files Browse the repository at this point in the history
  • Loading branch information
frankneumann committed Jan 29, 2015
1 parent 6d16b37 commit f798555
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/IntegrationTests/UpdateRoomTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ namespace IntegrationTests
[Trait("UpdateRoom", "")]
public class UpdateRoomTests : IDisposable
{
private readonly int _createdRoomId;
private readonly int _existingRoomId;
private readonly HipchatClient _client;
private readonly HipchatUser _owner;
public UpdateRoomTests()
{
HipchatApiConfig.AuthToken = TestsConfig.AuthToken;
_client = new HipchatClient();
var room = _client.CreateRoom("TestUpdateRoom");
_createdRoomId = room.Id;
_existingRoomId = TestHelpers.GetARoomId(_client, "TestUpdateRoom");

var getRoomResponse = _client.GetRoom(_createdRoomId);
var getRoomResponse = _client.GetRoom(_existingRoomId);
_owner = getRoomResponse.Owner;
}

Expand All @@ -33,13 +32,13 @@ public void CanUpdateRoom()
Owner = _owner
};

var result = _client.UpdateRoom(_createdRoomId, request);
var result = _client.UpdateRoom(_existingRoomId, request);

Assert.True(result);
}
public void Dispose()
{
_client.DeleteRoom(_createdRoomId);
_client.DeleteRoom(_existingRoomId);
}
}
}
5 changes: 2 additions & 3 deletions src/IntegrationTests/ViewRoomHistoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ public ViewRoomHistoryTests()
HipchatApiConfig.AuthToken = TestsConfig.AuthToken;
_client = new HipchatClient();

var room = _client.CreateRoom(roomName);
_existingRoomId = room.Id;
_existingRoomName = "Test ViewRoomHistory";
_existingRoomId = TestHelpers.GetARoomId(_client, roomName);
_existingRoomName = roomName;

// Add notifications to history
_client.SendNotification(_existingRoomId, "First entry to history");
Expand Down

0 comments on commit f798555

Please sign in to comment.