local F=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local I=require(F.Packages.Dex.VirtualInstanceCreators)return function()it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097 \110\101\119 \086\105\114\116\117\097\108\073\110\115\116\097\110\099\101 \117\115\105\110\103 \078\101\119\040\041",function()local F="\080\097\114\116"local s={Size=Vector3.new(10,10,10)}local v={Child1=I.New("\080\097\114\116")}local L=I.New(F,s,v);(expect(L._dectype)).to.equal("\086\105\114\116\117\097\108\073\110\115\116\097\110\099\101");(expect(L._constructorType)).to.equal("\078\101\119");(expect(L._constructorTypeArgument)).to.equal(F);(expect(#L._directives)).to.equal(2);(expect(L._directives[1]._payload)).to.equal(s);(expect(L._directives[2]._payload)).to.equal(v)end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097 \110\101\119 \086\105\114\116\117\097\108\073\110\115\116\097\110\099\101 \117\115\105\110\103 \067\108\111\110\101\040\041",function()local F=I.New("\080\097\114\116")local s={Size=Vector3.new(5,5,5)}local v={Child2=I.New("\080\097\114\116")}local L=I.Clone(F,s,v);(expect(L._dectype)).to.equal("\086\105\114\116\117\097\108\073\110\115\116\097\110\099\101");(expect(L._constructorType)).to.equal("\067\108\111\110\101");(expect(L._constructorTypeArgument)).to.equal(F);(expect(#L._directives)).to.equal(2);(expect(L._directives[1]._payload)).to.equal(s);(expect(L._directives[2]._payload)).to.equal(v)end)it("\115\104\111\117\108\100 \099\114\101\097\116\101 \097 \110\101\119 \086\105\114\116\117\097\108\073\110\115\116\097\110\099\101 \117\115\105\110\103 \080\114\101\109\097\100\101\040\041",function()local F={Size=Vector3.new(3,3,3)}local s={Child3=I.New("\080\097\114\116")}local v=I.Premade("\070\114\097\109\101",F,s);(expect(v._dectype)).to.equal("\086\105\114\116\117\097\108\073\110\115\116\097\110\099\101");(expect(v._constructorType)).to.equal("\080\114\101\109\097\100\101");(expect(v._constructorTypeArgument)).to.equal("\070\114\097\109\101");(expect(#v._directives)).to.equal(2);(expect(v._directives[1]._payload)).to.equal(F);(expect(v._directives[2]._payload)).to.equal(s)end)end
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local VirtualInstanceCreators = require(ReplicatedStorage.Packages.Dex.VirtualInstanceCreators)

return function()
    it("should create a new VirtualInstance using New()", function()
        local className = "Part"
        local props = {Size = Vector3.new(10, 10, 10)}
        local children = {Child1 = VirtualInstanceCreators.New("Part")}

        local virtualInstance = VirtualInstanceCreators.New(className, props,
            children)

        expect(virtualInstance._dectype).to.equal("VirtualInstance")
        expect(virtualInstance._constructorType).to.equal("New")
        expect(virtualInstance._constructorTypeArgument).to.equal(className)
        expect(#virtualInstance._directives).to.equal(2)
        expect(virtualInstance._directives[1]._payload).to.equal(props)
        expect(virtualInstance._directives[2]._payload).to.equal(children)
    end)

    it("should create a new VirtualInstance using Clone()", function()
        local template = VirtualInstanceCreators.New("Part")
        local props = {Size = Vector3.new(5, 5, 5)}
        local children = {Child2 = VirtualInstanceCreators.New("Part")}

        local virtualInstance = VirtualInstanceCreators.Clone(template, props,
            children)

        expect(virtualInstance._dectype).to.equal("VirtualInstance")
        expect(virtualInstance._constructorType).to.equal("Clone")
        expect(virtualInstance._constructorTypeArgument).to.equal(template)
        expect(#virtualInstance._directives).to.equal(2)
        expect(virtualInstance._directives[1]._payload).to.equal(props)
        expect(virtualInstance._directives[2]._payload).to.equal(children)
    end)

    it("should create a new VirtualInstance using Premade()", function()
        local props = {Size = Vector3.new(3, 3, 3)}
        local children = {Child3 = VirtualInstanceCreators.New("Part")}

        local virtualInstance =
            VirtualInstanceCreators.Premade("Frame", props, children)

        expect(virtualInstance._dectype).to.equal("VirtualInstance")
        expect(virtualInstance._constructorType).to.equal("Premade")
        expect(virtualInstance._constructorTypeArgument).to.equal("Frame")
        expect(#virtualInstance._directives).to.equal(2)
        expect(virtualInstance._directives[1]._payload).to.equal(props)
        expect(virtualInstance._directives[2]._payload).to.equal(children)
    end)
end