local j=import("\046\047\071\097\109\101")local A=import("\046\046\047\102\117\110\099\116\105\111\110\115\047\116\121\112\101\111\102")describe("\105\110\115\116\097\110\099\101\115\046\071\097\109\101",function()it("\115\104\111\117\108\100 \105\110\115\116\097\110\116\105\097\116\101",function()local A=j:new()assert.not_nil(A)end)describe("\071\101\116\083\101\114\118\105\099\101",function()it("\115\104\111\117\108\100 \104\097\118\101 \071\101\116\083\101\114\118\105\099\101",function()local A=j:new()local n=A:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")assert.not_nil(n)assert.equal(A.ReplicatedStorage,n)end)it("\115\104\111\117\108\100 \116\104\114\111\119 \119\104\101\110 \103\105\118\101\110 \105\110\118\097\108\105\100 \115\101\114\118\105\099\101 \110\097\109\101\115",function()local A=j:new()assert.has.errors(function()A:GetService("\083\079\077\069\084\072\073\078\071 \084\072\065\084 \087\073\076\076 \078\069\086\069\082 \069\088\073\083\084")end)end)end)it("\115\104\111\117\108\100 \104\097\118\101 \112\114\111\112\101\114\116\105\101\115 \100\101\102\105\110\101\100",function()local n=j:new()assert.equal(A(n.CreatorId),"\110\117\109\098\101\114")assert.equal(A(n.CreatorType),"\069\110\117\109\073\116\101\109")assert.equal(A(n.GameId),"\110\117\109\098\101\114")assert.equal(A(n.JobId),"\115\116\114\105\110\103")assert.equal(A(n.PlaceId),"\110\117\109\098\101\114")assert.equal(A(n.PlaceVersion),"\110\117\109\098\101\114")assert.equal(A(n.VIPServerId),"\115\116\114\105\110\103")assert.equal(A(n.VIPServerOwnerId),"\110\117\109\098\101\114")end)end)
local Game = import("./Game")
local typeof = import("../functions/typeof")

describe("instances.Game", function()
	it("should instantiate", function()
		local instance = Game:new()

		assert.not_nil(instance)
	end)

	describe("GetService", function()
		it("should have GetService", function()
			local instance = Game:new()

			local ReplicatedStorage = instance:GetService("ReplicatedStorage")

			assert.not_nil(ReplicatedStorage)
			assert.equal(instance.ReplicatedStorage, ReplicatedStorage)
		end)

		it("should throw when given invalid service names", function()
			local instance = Game:new()

			assert.has.errors(function()
				instance:GetService("SOMETHING THAT WILL NEVER EXIST")
			end)
		end)
	end)

	it("should have properties defined", function()
		local instance = Game:new()

		assert.equal(typeof(instance.CreatorId), "number")
		assert.equal(typeof(instance.CreatorType), "EnumItem")
		assert.equal(typeof(instance.GameId), "number")
		assert.equal(typeof(instance.JobId), "string")
		assert.equal(typeof(instance.PlaceId), "number")
		assert.equal(typeof(instance.PlaceVersion), "number")
		assert.equal(typeof(instance.VIPServerId), "string")
		assert.equal(typeof(instance.VIPServerOwnerId), "number")
	end)
end)