public async Task CanJoinChatRoom() { RealtimeDataService service = new RealtimeDataService(); ChatRoom room = new ChatRoom() { Name = "testRoom", Id = TestRoomId }; await service.CreateChatRoom(room); User testUser = new User() { Name = "testUser1", Id = TestUser1Id }; await service.Register(testUser); User testUser2 = new User() { Name = "testUser2", Id = TestUser2Id }; await service.Register(testUser2); List <User> peopleFromDb = await service.GetAllUsers(); ChatRoom roomFromDb = await service.GetChatRoom(TestRoomId); foreach (var person in peopleFromDb) { await service.JoinChatRoom(person.Id, roomFromDb.Id); } }
public async Task CanCreateChatRoom() { RealtimeDataService service = new RealtimeDataService(); ChatRoom room = new ChatRoom() { Name = "testRoom", Id = TestRoomId }; await service.CreateChatRoom(room); ChatRoom roomFromDb = await service.GetChatRoom(TestRoomId); Assert.AreEqual(room.Name, roomFromDb.Name); }