return function()local x=require(script.Parent.MockContextActionService)describe("\066\105\110\100\065\099\116\105\111\110\065\116\080\114\105\111\114\105\116\121",function()it("\115\104\111\117\108\100 \098\105\110\100 \097\110 \097\099\116\105\111\110",function()x:BindActionAtPriority("\102\111\111",function() end,false,2000,Enum.KeyCode.E);(expect(x._actions.foo)).to.be.ok()end)end)describe("\085\110\098\105\110\100\065\099\116\105\111\110",function()it("\115\104\111\117\108\100 \117\110\098\105\110\100 \097\110 \097\099\116\105\111\110",function()x:BindActionAtPriority("\102\111\111",function() end,false,2000,Enum.KeyCode.E);(expect(x._actions.foo)).to.be.ok()x:UnbindAction("\102\111\111");(expect(x._actions.foo)).to.never.be.ok()end)end)describe("\083\105\109\117\108\097\116\101\073\110\112\117\116",function()it("\115\104\111\117\108\100 \115\105\109\117\108\097\116\101 \097 \107\101\121 \112\114\101\115\115 \116\104\097\116 \116\114\105\103\103\101\114\115 \097 \098\111\117\110\100 \097\099\099\116\105\111\110\'\115 \099\097\108\108\098\097\099\107 \097\116 \116\104\101 \098\101\103\105\110\110\105\110\103 \097\110\100 \101\110\100",function()local M=0 local function P(x)expect(x.UserInputState==Enum.UserInputState.Begin or x.UserInputState==Enum.UserInputState.End)M=M+1 end x:BindActionAtPriority("\102\111\111",P,false,2000,Enum.KeyCode.E)x:SimulateInput(Enum.KeyCode.E);(expect(M)).to.equal(2)end)end)describe("\083\105\109\117\108\097\116\101\073\110\112\117\116\066\101\103\105\110",function()it("\115\104\111\117\108\100 \115\105\109\117\108\097\116\101 \097 \107\101\121 \112\114\101\115\115 \116\104\097\116 \116\114\105\103\103\101\114\115 \097 \098\111\117\110\100 \097\099\099\116\105\111\110\'\115 \099\097\108\108\098\097\099\107 \097\116 \116\104\101 \098\101\103\105\110\110\105\110\103",function()local M=0 local function P(x)expect(x.UserInputState==Enum.UserInputState.Begin)M=M+1 end x:BindActionAtPriority("\102\111\111",P,false,2000,Enum.KeyCode.E)x:SimulateInputBegin(Enum.KeyCode.E);(expect(M)).to.equal(1)end)end)describe("\083\105\109\117\108\097\116\101\073\110\112\117\116\069\110\100",function()it("\115\104\111\117\108\100 \115\105\109\117\108\097\116\101 \097 \107\101\121 \112\114\101\115\115 \116\104\097\116 \116\114\105\103\103\101\114\115 \097 \098\111\117\110\100 \097\099\099\116\105\111\110\'\115 \099\097\108\108\098\097\099\107 \097\116 \116\104\101 \101\110\100",function()local M=0 local function P(x)expect(x.UserInputState==Enum.UserInputState.End)M=M+1 end x:BindActionAtPriority("\102\111\111",P,false,2000,Enum.KeyCode.E)x:SimulateInputBegin(Enum.KeyCode.E);(expect(M)).to.equal(1)end)end)end
return function()
	local MockContextActionService = require(script.Parent.MockContextActionService)

	describe("BindActionAtPriority", function()
		it("should bind an action", function()
			MockContextActionService:BindActionAtPriority("foo", function() end, false, 2000, Enum.KeyCode.E)
			expect(MockContextActionService._actions.foo).to.be.ok()
		end)
	end)

	describe("UnbindAction", function()
		it("should unbind an action", function()
			MockContextActionService:BindActionAtPriority("foo", function() end, false, 2000, Enum.KeyCode.E)

			expect(MockContextActionService._actions.foo).to.be.ok()

			MockContextActionService:UnbindAction("foo")

			expect(MockContextActionService._actions.foo).to.never.be.ok()
		end)
	end)

	describe("SimulateInput", function()
		it("should simulate a key press that triggers a bound acction's callback at the beginning and end", function()
			local callCount = 0

			local function callback(input)
				expect(
					input.UserInputState == Enum.UserInputState.Begin or input.UserInputState == Enum.UserInputState.End
				)

				callCount = callCount + 1
			end

			MockContextActionService:BindActionAtPriority("foo", callback, false, 2000, Enum.KeyCode.E)
			MockContextActionService:SimulateInput(Enum.KeyCode.E)

			expect(callCount).to.equal(2)
		end)
	end)

	describe("SimulateInputBegin", function()
		it("should simulate a key press that triggers a bound acction's callback at the beginning", function()
			local callCount = 0

			local function callback(input)
				expect(input.UserInputState == Enum.UserInputState.Begin)
				callCount = callCount + 1
			end

			MockContextActionService:BindActionAtPriority("foo", callback, false, 2000, Enum.KeyCode.E)
			MockContextActionService:SimulateInputBegin(Enum.KeyCode.E)

			expect(callCount).to.equal(1)
		end)
	end)

	describe("SimulateInputEnd", function()
		it("should simulate a key press that triggers a bound acction's callback at the end", function()
			local callCount = 0

			local function callback(input)
				expect(input.UserInputState == Enum.UserInputState.End)
				callCount = callCount + 1
			end

			MockContextActionService:BindActionAtPriority("foo", callback, false, 2000, Enum.KeyCode.E)
			MockContextActionService:SimulateInputBegin(Enum.KeyCode.E)

			expect(callCount).to.equal(1)
		end)
	end)
end
