input: Write a python function to simulate a number guessing game, where the function takes a random number generator and user input function as parameters to facilitate testing.
  assert number_guessing_game(lambda: 5, lambda x: 5) == "You guessed correctly in 1 guesses! The number was 5"
  assert number_guessing_game(lambda: 7, lambda x: 3) == "Wrong guess. Try again."
  assert number_guessing_game(lambda: 3, lambda x: 3) == "You guessed correctly in 1 guesses! The number was 3"
output: def number_guessing_game(random_number_generator, user_input_function):
      target_number = random_number_generator()
      guess_count = 0
      while True:
          guess = user_input_function("Enter your guess: ")
          guess_count += 1
          if guess == target_number:
              return f"You guessed correctly in {guess_count} guesses! The number was {target_number}"
          else:
              return "Wrong guess. Try again."