Exemplo n.º 1
0
        public async Task Given_RoomNameAndUserName_When_InvalidRoomName_Then_JoinRoomShouldNotAddUserInRoom()
        {
            Assert.False(DbInMemorySqlite.Rooms.Any());
            DatabaseSetup.AddUser(DbInMemorySqlite);
            _messageHub = new MessageHub(DbInMemorySqlite);
            AssignToHubRequiredProperties(_messageHub);
            await _messageHub.CreateRoom(new RoomModel { RoomName = "RoomieGroomie", UserName = "******", Category = ItemCategory.categories[0] }, new ItemModel { Name = "Flowers", Category = ItemCategory.categories[0], Description = "A flower", URL = "flowerurlhahahehe.com" });

            await _messageHub.JoinRoom("CameraCareNuExista", "Vasea");

            var userFromDb = DbInMemorySqlite.Users.FirstOrDefault();

            Assert.Null(userFromDb.Room);
        }