Module:WikiProject assessment progression/testcases
Appearance
![]() | This is the test cases page for the module Module:WikiProject assessment progression. Results of the test cases. |
-- Unit tests for [[Module:WikiProject assessment progression]]. Click talk page to run tests.
local myModule = require('Module:WikiProject assessment progression/sandbox')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()
function suite:assertTypeEquals(expectedType, functionName)
local outputType = type(functionName)
self:assertEquals(expectedType, outputType)
end
-- Test to make sure test function itself is working
function suite:test_assertTypeEquals_returns_correctly()
self:assertTypeEquals('number', 10)
end
--[[
function suite:test_percentComplete_outputs_number_as_string()
local percentComplete = myModule.percentComplete(10,20)
self:assertTypeEquals('string', percentComplete)
end
--]]
function suite:test_module_outputs_number_as_string()
local asString = '{{#invoke:WikiProject assessment progression|main|project=spaceflight}}'
local asNumber = tonumber(asString)
self:assertTypeEquals('string', asString)
self:assertTypeEquals('number', asNumber)
end
return suite