local F=require(script.Parent.CharacterEntity)local t=F:Extend("\084\101\115\116\080\108\097\121\101\114\069\110\116\105\116\121")function t.constructor(t)F:super(t,200)end return function()it("\115\104\111\117\108\100 \104\097\118\101 \097\110 \105\100",function()local F=t.new();(expect(F:GetId())).to.be.ok()end)it("\115\104\111\117\108\100 \104\097\110\100\108\101 \104\101\097\108\116\104",function()local F=t.new();(expect(F:GetHealth())).to.equal(200);(expect(F:IsAlive())).to.equal(true)end)it("\115\104\111\117\108\100 \098\101 \097\098\108\101 \116\111 \109\111\100\105\102\121 \104\101\097\108\116\104",function()local F=t.new()F:SetHealth(1000);(expect(F:GetHealth())).to.equal(1000)end)it("\115\104\111\117\108\100 \098\101 \097\098\108\101 \116\111 \104\101\097\108 \097\110\100 \116\097\107\101 \100\097\109\097\103\101",function()local F=t.new()F:TakeDamage(50);(expect(F:GetHealth())).to.equal(150)F:Heal(20);(expect(F:GetHealth())).to.equal(170)F:Heal(100);(expect(F:GetHealth())).to.equal(200)F:TakeDamage(2147483647.0);(expect(F:GetHealth())).to.equal(0)end)it("\115\104\111\117\108\100 \104\097\110\100\108\101 \115\116\097\116\115",function()local F=t.new()F:SetStat("\069\110\100\117\114\097\110\099\101",10);(expect(F:GetStat("\069\110\100\117\114\097\110\099\101"))).to.equal(10);(expect((F:GetStats()).Endurance)).to.equal(10)F:SetStats({Strength=20});(expect((F:GetStats()).Strength)).to.equal(20)end)end
local CharacterEntity = require(script.Parent.CharacterEntity)
local TestPlayerEntity = CharacterEntity:Extend("TestPlayerEntity")
function TestPlayerEntity:constructor()
	CharacterEntity:super(self, 200)
end

return function()
	it(
		"should have an id",
		function()
			local test = TestPlayerEntity.new()
			expect(test:GetId()).to.be.ok()
		end
	)
	it(
		"should handle health",
		function()
			local test = TestPlayerEntity.new()
			expect(test:GetHealth()).to.equal(200)
			expect(test:IsAlive()).to.equal(true)
		end
	)

	it(
		"should be able to modify health",
		function()
			local test = TestPlayerEntity.new()
			test:SetHealth(1000)

			expect(test:GetHealth()).to.equal(1000)
		end
	)

	it(
		"should be able to heal and take damage",
		function()
			local test = TestPlayerEntity.new()
			test:TakeDamage(50)
			expect(test:GetHealth()).to.equal(150)

			test:Heal(20)
			expect(test:GetHealth()).to.equal(170)

			test:Heal(100)
			expect(test:GetHealth()).to.equal(200)

			test:TakeDamage(2 ^ 31 - 1)
			expect(test:GetHealth()).to.equal(0)
		end
	)

	it(
		"should handle stats",
		function()
			local character = TestPlayerEntity.new()
			character:SetStat("Endurance", 10)

			expect(character:GetStat("Endurance")).to.equal(10)

			expect(character:GetStats().Endurance).to.equal(10)

			character:SetStats({
				Strength = 20
			})

			expect(character:GetStats().Strength).to.equal(20)
		end
	)
end
