comparison Modules/UnitTests.lua @ 82:e9f7bc9199ca release 2010-08-05

Fixed Bug 23 - When you purchase multiple stacks of the same item and it is one you have not invested in yet, ItemAuditor mistakenly counted items you have not yet pulled from the mail as items you already owned. This resulted in those items being counted twice.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Thu, 05 Aug 2010 22:20:44 -0700
parents 4ae431c98059
children
comparison
equal deleted inserted replaced
81:64166ba5209a 82:e9f7bc9199ca
122 items = {}, 122 items = {},
123 item_account = {}, 123 item_account = {},
124 }, 124 },
125 } 125 }
126 126
127 backups['Altoholic.GetItemCount'] = Altoholic.GetItemCount 127 backups['ItemAuditor.GetItemCount'] = ItemAuditor.GetItemCount
128 Altoholic.GetItemCount = function(self, id) 128 ItemAuditor.GetItemCount = function(self, id)
129 local total = GetItemCount(id) 129 local total = GetItemCount(id)
130 total = total + (fakeAlts[id] or 0) 130 total = total + (fakeAlts[id] or 0)
131 131
132 return total 132 return total
133 end 133 end
138 end; 138 end;
139 tearDown = function() 139 tearDown = function()
140 ItemAuditor:Print('Unit Test tearDown') 140 ItemAuditor:Print('Unit Test tearDown')
141 ItemAuditor:UpdateCurrentInventory() 141 ItemAuditor:UpdateCurrentInventory()
142 ItemAuditor.db = backups['ItemAuditor.db'] 142 ItemAuditor.db = backups['ItemAuditor.db']
143 Altoholic.GetItemCount = backups['Altoholic.GetItemCount'] 143 ItemAuditor.GetItemCount = backups['ItemAuditor.GetItemCount']
144 end; 144 end;
145 145
146 testMockGetContainerItemLink = function() 146 testMockGetContainerItemLink = function()
147 assert(GetContainerItemLink(0, 1) == FROSTWEAVE) 147 assert(GetContainerItemLink(0, 1) == FROSTWEAVE)
148 end; 148 end;