FANDOM


--<pre> Needs more tests
local suite = require("Dev:ScribuntoUnit/sandbox"):new()
local dbgModule = require("Dev:Debug")
local childArgs = {[1]="childArg1",["arg2"] ="childArg2"}
local parentArgs = {[1]="parentArg1",["arg2"] ="parentArg2"}
 
function suite:test_childArgs()
    local frame = dbgModule.frame(childArgs)
 
    self:assertDeepEquals(frame.args,childArgs,"Child arguments are not correct")
end
 
function suite:test_parentArgs()
    local frame = dbgModule.frame(nil,parentArgs)
 
    self:assertDeepEquals(frame:getParent().args,parentArgs,"Parent arguments are not correct")
end
 
function suite:test_get_Parent_Child_Args()
    local frame = dbgModule.frame(childArgs, parentArgs)
 
    self:assertDeepEquals(frame.args,childArgs,"Child arguments are not correct")
    self:assertDeepEquals(frame:getParent().args,parentArgs,"Parent arguments are not correct")
end
 
function suite:test_no_Parent_Child_Args()
    local frame = dbgModule.frame()
 
    self:assertDeepEquals(frame.args,{},"Child arguments are not correct")
    self:assertDeepEquals(frame:getParent().args,{},"Parent arguments are not correct")
end
 
function suite:test_invoke_getParent_twice()
    local frame = dbgModule.frame()
 
    self:assertEquals(frame:getParent():getParent(),nil,"Grandparent should be nil")
end
 
return suite

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.