From 11fd218253eda68e30ff22eba97f7beaf88678d5 Mon Sep 17 00:00:00 2001 From: Ilias Mentzelos Date: Thu, 5 Mar 2020 21:24:38 +0200 Subject: [PATCH] Enhance tests with conjured --- TypeScript/test/gilded-rose.spec.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/TypeScript/test/gilded-rose.spec.ts b/TypeScript/test/gilded-rose.spec.ts index 96c9f694..84e06cf6 100644 --- a/TypeScript/test/gilded-rose.spec.ts +++ b/TypeScript/test/gilded-rose.spec.ts @@ -105,4 +105,20 @@ describe('Gilded Rose', function () { expect(items[0].sellIn).to.equal(-1); expect(items[0].quality).to.equal(0); }); + + it('should decrease by 2 before the sell date for "Conjured"', function() { + const gildedRose = new GildedRose([ new Item('Conjured', 10, 40) ]); + const items = gildedRose.updateQuality(); + expect(items[0].name).to.equal('Conjured'); + expect(items[0].sellIn).to.equal(9); + expect(items[0].quality).to.equal(38); + }); + + it('should decrease by 4 after the sell date for "Conjured"', function() { + const gildedRose = new GildedRose([ new Item('Conjured', 0, 40) ]); + const items = gildedRose.updateQuality(); + expect(items[0].name).to.equal('Conjured'); + expect(items[0].sellIn).to.equal(9); + expect(items[0].quality).to.equal(36); + }); });