Module:FEHStatUtil/testcases

local FEHStatUtil = require 'Module:FEHStatUtil' local suite = require 'Module:ScribuntoUnit':new

function suite:testGetMasterGrowthRate suite:assertEquals(50, FEHStatUtil.getMasterGrowthRate(3, 50)) suite:assertEquals(45, FEHStatUtil.getMasterGrowthRate(3, 45)) suite:assertEquals(55, FEHStatUtil.getMasterGrowthRate(3, 55))

suite:assertEquals(57, FEHStatUtil.getMasterGrowthRate(5, 50)) suite:assertEquals(51, FEHStatUtil.getMasterGrowthRate(5, 45)) suite:assertEquals(62, FEHStatUtil.getMasterGrowthRate(5, 55))

suite:assertEquals(43, FEHStatUtil.getMasterGrowthRate(1, 50)) suite:assertEquals(38, FEHStatUtil.getMasterGrowthRate(1, 45)) suite:assertEquals(47, FEHStatUtil.getMasterGrowthRate(1, 55)) end

function suite:testGetGrowthValue suite:assertEquals(19, FEHStatUtil.getGrowthValue(3, 50)) suite:assertEquals(17, FEHStatUtil.getGrowthValue(3, 45)) suite:assertEquals(21, FEHStatUtil.getGrowthValue(3, 55))

suite:assertEquals(22, FEHStatUtil.getGrowthValue(5, 50)) suite:assertEquals(19, FEHStatUtil.getGrowthValue(5, 45)) suite:assertEquals(24, FEHStatUtil.getGrowthValue(5, 55)) end

function suite:testGetSupergrowth suite:assertEquals(-1, FEHStatUtil.getSupergrowth(5, 50)) suite:assertEquals(1, FEHStatUtil.getSupergrowth(5, 45)) suite:assertEquals(0, FEHStatUtil.getSupergrowth(5, 55)) end

function suite:testFindGrowthRate suite:assertEquals(50, FEHStatUtil.findGrowthRate(3, 19)) suite:assertEquals(45, FEHStatUtil.findGrowthRate(3, 17)) suite:assertEquals(55, FEHStatUtil.findGrowthRate(3, 21))

suite:assertEquals(50, FEHStatUtil.findGrowthRate(5, 22)) suite:assertEquals(45, FEHStatUtil.findGrowthRate(5, 19)) suite:assertEquals(55, FEHStatUtil.findGrowthRate(5, 24)) end

function suite:testGetRarityBonuses suite:assertDeepEquals({		{0, 0, 0, 0, 0},		{0, 1, 1, 0, 0},		{1, 1, 1, 1, 1},		{1, 2, 2, 1, 1},		{2, 2, 2, 2, 2},	}, FEHStatUtil.getRarityBonuses {15, 9, 8, 7, 6}) suite:assertDeepEquals({		{0, 0, 0, 0, 0},		{0, 0, 0, 1, 1},		{1, 1, 1, 1, 1},		{1, 1, 1, 2, 2},		{2, 2, 2, 2, 2},	}, FEHStatUtil.getRarityBonuses {15, 6, 7, 8, 9}) suite:assertDeepEquals({		{0, 0, 0, 0, 0},		{0, 1, 1, 0, 0},		{1, 1, 1, 1, 1},		{1, 2, 2, 1, 1},		{2, 2, 2, 2, 2},	}, FEHStatUtil.getRarityBonuses {15, 9, 9, 9, 9}) suite:assertDeepEquals({		{0, 0, 0, 0, 0},		{0, 0, 1, 0, 1},		{1, 1, 1, 1, 1},		{1, 1, 2, 1, 2},		{2, 2, 2, 2, 2},	}, FEHStatUtil.getRarityBonuses {15, 8, 9, 8, 9}) suite:assertDeepEquals({		{0, 0, 0, 0, 0},		{0, 0, 1, 1, 0},		{1, 1, 1, 1, 1},		{1, 1, 2, 2, 1},		{2, 2, 2, 2, 2},	}, FEHStatUtil.getRarityBonuses {15, 8, 9, 9, 9}) end

function suite:testFullLv1Stats suite:assertDeepEquals({		{13, 7, 6, 5, 4},		{13, 8, 7, 5, 4},		{14, 8, 7, 6, 5},		{14, 9, 8, 6, 5},		{15, 9, 8, 7, 6},	}, FEHStatUtil.fullLv1Stats {15, 9, 8, 7, 6}) suite:assertDeepEquals({		{13, 4, 5, 6, 7},		{13, 4, 5, 7, 8},		{14, 5, 6, 7, 8},		{14, 5, 6, 8, 9},		{15, 6, 7, 8, 9},	}, FEHStatUtil.fullLv1Stats {15, 6, 7, 8, 9}) suite:assertDeepEquals({		{13, 7, 7, 7, 7},		{13, 8, 8, 7, 7},		{14, 8, 8, 8, 8},		{14, 9, 9, 8, 8},		{15, 9, 9, 9, 9},	}, FEHStatUtil.fullLv1Stats {15, 9, 9, 9, 9}) suite:assertDeepEquals({		{13, 6, 7, 6, 7},		{13, 6, 8, 6, 8},		{14, 7, 8, 7, 8},		{14, 7, 9, 7, 9},		{15, 8, 9, 8, 9},	}, FEHStatUtil.fullLv1Stats {15, 8, 9, 8, 9}) suite:assertDeepEquals({		{13, 6, 7, 7, 7},		{13, 6, 8, 8, 7},		{14, 7, 8, 8, 8},		{14, 7, 9, 9, 8},		{15, 8, 9, 9, 9},	}, FEHStatUtil.fullLv1Stats {15, 8, 9, 9, 9}) end

function suite:testFullLv40Stats suite:markTestSkipped end

return suite