Added 'gilded-rose-enhanced.ts' file to start refactoring and to compare against the original version.
Added static variable 'itemType'.
This will help in further additions of items belonging to same itemType without adding new code.
Updated updateQuantity method to take individual item and itemType as parameter.
- Backstage passes.
Tests added to validate the 'Backstage passes to a TAFKAL80ETC concert' item. - Sulfuras, Hand of Ragnaros logic.
Tests added to validate the 'Sulfuras, Hand of Ragnaros' item. - Aged Brie logic.
Tests added to validate the 'Aged Brie' item. - All other items logic.
Tests added to validate all other normal items. - Conjured items logic.
Tests added to validate the 'Conjured' items.
-------- day 0 --------
name, sellIn, quality
+5 Dexterity Vest 10 20
Aged Brie 2 0
Elixir of the Mongoose 5 7
Sulfuras, Hand of Ragnaros 0 80
Sulfuras, Hand of Ragnaros -1 80
Backstage passes to a TAFKAL80ETC concert 15 20
Backstage passes to a TAFKAL80ETC concert 10 20
Backstage passes to a TAFKAL80ETC concert 5 20
Backstage passes to a TAFKAL80ETC concert 10 49
Backstage passes to a TAFKAL80ETC concert 5 49
Conjured Mana Cake 3 6
-------- day 1 --------
name, sellIn, quality
+5 Dexterity Vest 9 19
Aged Brie 1 1
Elixir of the Mongoose 4 6
Sulfuras, Hand of Ragnaros 0 80
Sulfuras, Hand of Ragnaros -1 80
Backstage passes to a TAFKAL80ETC concert 14 21
Backstage passes to a TAFKAL80ETC concert 9 22
Backstage passes to a TAFKAL80ETC concert 4 23
Backstage passes to a TAFKAL80ETC concert 9 50
Backstage passes to a TAFKAL80ETC concert 4 50
Conjured Mana Cake 2 5 (The Conjured item quality is not calculcated correctly.)
-------- day 1 --------
name, sellIn, quality
+5 Dexterity Vest 9 19
Aged Brie 1 1
Elixir of the Mongoose 4 6
Sulfuras, Hand of Ragnaros 0 80
Sulfuras, Hand of Ragnaros -1 80
Backstage passes to a TAFKAL80ETC concert 14 21
Backstage passes to a TAFKAL80ETC concert 9 22
Backstage passes to a TAFKAL80ETC concert 4 23
Backstage passes to a TAFKAL80ETC concert 9 50
Backstage passes to a TAFKAL80ETC concert 4 50
Conjured Mana Cake 2 4 (The Conjured item quality is now calculated correctly. It is decreased at twice the rate of normal item.)
Run command: npm test