Add test of room user count

This commit is contained in:
nxshock 2019-07-22 22:29:18 +05:00
parent 213abebf0a
commit 38f9c25b1b

View File

@ -103,3 +103,21 @@ func TestLeaveRoom(t *testing.T) {
err = user.LeaveRoom(room) err = user.LeaveRoom(room)
assert.NotNil(t, err) assert.NotNil(t, err)
} }
func TestRoomUserCount(t *testing.T) {
backend := NewBackend("localhost")
user1, _, err := backend.Register("user1", "", "")
assert.Nil(t, err)
request := createroom.Request{
RoomAliasName: "room1",
Name: "room1",
Topic: "topic"}
room, err := user1.CreateRoom(request)
assert.Nil(t, err)
assert.Len(t, room.Users(), 1)
// TODO: add join another user test
}