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 CanCreateUser() { RealtimeDataService service = new RealtimeDataService(); User person = new User() { Name = "testUser", Id = TestUser1Id }; await service.Register(person); await service.Register(person); User personFromDb = await service.GetUser(TestUser1Id); Assert.AreEqual(person.Name, personFromDb.Name); }