defmodule SnmpKitTest do
  use ExUnit.Case, async: true

  doctest SnmpKit

  # Simple test to verify module loads
  test "module loads correctly" do
    assert is_atom(SnmpKit)
    assert is_atom(SnmpKit.SNMP)
    assert is_atom(SnmpKit.MIB)
  end

  describe "SnmpKit.SNMP bang methods" do
    test "get_bulk!/2 raises on error" do
      # Bang method should raise when underlying function returns error
      assert_raise RuntimeError, ~r/get_bulk! failed/, fn ->
        SnmpKit.SNMP.get_bulk!("192.0.2.1", "1.3.6.1.2.1.1")
      end
    end

    test "get_bulk!/3 raises on error with options" do
      assert_raise RuntimeError, ~r/get_bulk! failed/, fn ->
        SnmpKit.SNMP.get_bulk!("192.0.2.1", "1.3.6.1.2.1.1", timeout: 100)
      end
    end

    test "bulk_walk!/2 raises on error" do
      assert_raise RuntimeError, ~r/bulk_walk! failed/, fn ->
        SnmpKit.SNMP.bulk_walk!("192.0.2.1", "1.3.6.1.2.1.1")
      end
    end

    test "bulk_walk!/3 raises on error with options" do
      assert_raise RuntimeError, ~r/bulk_walk! failed/, fn ->
        SnmpKit.SNMP.bulk_walk!("192.0.2.1", "1.3.6.1.2.1.1", timeout: 100)
      end
    end
  end
end
