@@ -61,6 +61,45 @@ describe("TradeQuery", function()
6161 assert .are .equal (0 , # tooltip .lines )
6262 end )
6363 end )
64+ describe (" GetResultEvaluation" , function ()
65+ it (" evaluates a socketed Megalomaniac by node combination" , function ()
66+ local slotTbl = {
67+ slotName = " Megalomaniac" , unique = true , alreadyCorrupted = true , selectedJewelNodeId = 12345 ,
68+ }
69+ local tq = new (" TradeQuery" ):TradeQuery ({ itemsTab = {} })
70+ tq .statSortSelectionList = {}
71+ tq .tradeQueryGenerator = new (" TradeQueryGenerator" ):TradeQueryGenerator ({ itemsTab = {} })
72+ tq .itemsTab .build = {
73+ spec = {
74+ tree = {
75+ clusterNodeMap = {
76+ [" Node One" ] = { dn = " Node One" },
77+ [" Node Two" ] = { dn = " Node Two" },
78+ [" Node Three" ] = { dn = " Node Three" },
79+ }
80+ }
81+ }
82+ }
83+ tq .slotTables [1 ] = slotTbl
84+ tq .resultTbl [1 ] = {
85+ [1 ] = {
86+ item_string = table.concat ({
87+ " 1 Added Passive Skill is Node One" ,
88+ " 1 Added Passive Skill is Node Two" ,
89+ " 1 Added Passive Skill is Node Three" ,
90+ }, " \n " )
91+ }
92+ }
93+
94+ local evaluation = tq :GetResultEvaluation (1 , 1 , function () return {} end , {})
95+
96+ assert .are .equal (4 , # evaluation )
97+ for _ , entry in ipairs (evaluation ) do
98+ assert .is_table (entry .DNs )
99+ assert .is_true (# entry .DNs >= 2 )
100+ end
101+ end )
102+ end )
64103 describe (" ReduceOutput" , function ()
65104 it (" preserves lower-is-better values for weighted result comparison" , function ()
66105 local weights = {
0 commit comments