--!native
--!nonstrict
--!optimize 2
-- Compiled with roblox-ts v2.3.0
local TS = _G[script]
--/ <reference types="@rbxts/testez/globals" />
local MaxPriorityQueue = TS.import(script, script.Parent.Parent, "max-priority-queue").MaxPriorityQueue
return function()
	describe("MaxPriorityQueue", function()
		describe("constructor", function()
			it("should return a MaxPriorityQueue", function()
				expect(TS.instanceof(MaxPriorityQueue.new(), MaxPriorityQueue)).to.equal(true)
			end)
		end)
		describe("MaxPriorityQueue.isEmpty", function()
			it("should return a boolean", function()
				expect(MaxPriorityQueue.new():isEmpty()).to.be.a("boolean")
			end)
			it("should return true if empty", function()
				expect(MaxPriorityQueue.new():isEmpty()).to.equal(true)
			end)
			it("should return false if not empty", function()
				local queue = MaxPriorityQueue.new()
				queue:insertWithPriority("value", 1)
				expect(queue:isEmpty()).to.equal(false)
			end)
		end)
		describe("MaxPriorityQueue.insertWithPriority", function()
			it("should return a number", function()
				expect(MaxPriorityQueue.new():insertWithPriority("1", 1)).to.be.a("number")
			end)
			it("should insert into the proper location", function()
				local queue = MaxPriorityQueue.new()
				queue:insertWithPriority("2", 2)
				queue:insertWithPriority("3", 3)
				expect(queue:insertWithPriority("1", 1)).to.equal(0)
			end)
		end)
		describe("MaxPriorityQueue.changePriority", function()
			it("should return a number", function()
				local queue = MaxPriorityQueue.new()
				queue:insertWithPriority("1", 4)
				queue:insertWithPriority("2", 2)
				queue:insertWithPriority("3", 3)
				expect(queue:changePriority("1", 1)).to.be.a("number")
			end)
			it("should return adjusted location", function()
				local queue = MaxPriorityQueue.new()
				queue:insertWithPriority("1", 4)
				queue:insertWithPriority("2", 2)
				queue:insertWithPriority("3", 3)
				expect(queue:changePriority("1", 1)).to.equal(0)
			end)
			it("should throw if the passed value is null", function()
				expect(function()
					return MaxPriorityQueue.new():changePriority("1", 1)
				end).to:throw()
			end)
		end)
	end)
end
