defmodule Towerops.AgentsFixtures do
  @moduledoc """
  This module defines test helpers for creating
  entities via the `Towerops.Agents` context.
  """

  alias Towerops.Agents

  def unique_agent_name, do: "Test Agent #{System.unique_integer()}"

  def agent_token_fixture(organization_id, name \\ nil) do
    name = name || unique_agent_name()
    Agents.create_agent_token(organization_id, name)
  end

  def agent_assignment_fixture(agent_token_id, device_id) do
    Agents.assign_device_to_agent(agent_token_id, device_id)
  end
end
