Current section
Files
Jump to
Current section
Files
test/ray_casting_test.exs
defmodule RayCastingTest do
use ExUnit.Case
doctest RayCasting
setup_all do
path = [
%{ lat: 33.5362475, lng: -111.9267386 },
%{ lat: 33.5104882, lng: -111.9627875 },
%{ lat: 33.5004686, lng: -111.9027061 },
]
{:ok, [path: path]}
end
test "point inside polygon", %{path: path} do
point = %{ lat: 33.5204882, lng: -111.9327875 }
assert RayCasting.rayCasting(path, point) == true
end
test "point outside polygon", %{path: path} do
point = %{ lat: 30.5204882, lng: -110.9327875 }
assert RayCasting.rayCasting(path, point) == false
end
end