当前位置: 首页>>代码示例>>C#>>正文


C# Item.ShouldBeEquivalentTo方法代码示例

本文整理汇总了C#中Item.ShouldBeEquivalentTo方法的典型用法代码示例。如果您正苦于以下问题:C# Item.ShouldBeEquivalentTo方法的具体用法?C# Item.ShouldBeEquivalentTo怎么用?C# Item.ShouldBeEquivalentTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Item的用法示例。


在下文中一共展示了Item.ShouldBeEquivalentTo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BackstagePassShouldLoseQualityOnSellInDate

        public void BackstagePassShouldLoseQualityOnSellInDate()
        {
            IList<Item> items = new List<Item> { new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 0, Quality = 5 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = -1, Quality = 0 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例2: AgedBrieShouldIncreaseInQualityTwiceAsFastAfterSellInDate

        public void AgedBrieShouldIncreaseInQualityTwiceAsFastAfterSellInDate()
        {
            IList<Item> items = new List<Item> { new Item { Name = "Aged Brie", SellIn = 0, Quality = 5 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "Aged Brie", SellIn = -1, Quality = 7 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例3: BackstagePassShouldIncreaseInQualityTwiceAsFastWhenConcertIsApproaching

        public void BackstagePassShouldIncreaseInQualityTwiceAsFastWhenConcertIsApproaching()
        {
            IList<Item> items = new List<Item> { new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 10, Quality = 5 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 9, Quality = 7 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例4: ConjuredItemsShouldLoseQualityTwiceAsFast

        public void ConjuredItemsShouldLoseQualityTwiceAsFast()
        {
            IList<Item> items = new List<Item> { new Item { Name = "Conjured foo", SellIn = 10, Quality = 5 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "Conjured foo", SellIn = 9, Quality = 3 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例5: SulfurasShouldNotChangeQuality

        public void SulfurasShouldNotChangeQuality()
        {
            IList<Item> items = new List<Item> { new Item { Name = "Sulfuras, Hand of Ragnaros", SellIn = 10, Quality = 80 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "Sulfuras, Hand of Ragnaros", SellIn = 10, Quality = 80 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例6: ItemShouldNotIncreaseInQualityAbove50

        public void ItemShouldNotIncreaseInQualityAbove50()
        {
            IList<Item> items = new List<Item> { new Item { Name = "Aged Brie", SellIn = 10, Quality = 50 }, new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 20, Quality = 50 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var brie = new Item { Name = "Aged Brie", SellIn = 9, Quality = 50 };
            brie.ShouldBeEquivalentTo(items[0]);

            var concert = new Item { Name = "Backstage passes to a TAFKAL80ETC concert", SellIn = 19, Quality = 50 };
            concert.ShouldBeEquivalentTo(items[1]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:13,代码来源:GildedRoseTest.cs

示例7: ItemShouldNeverDegradeBelowZero

        public void ItemShouldNeverDegradeBelowZero()
        {
            IList<Item> items = new List<Item> { new Item { Name = "foo", SellIn = 0, Quality = 0 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "foo", SellIn = -1, Quality = 0 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例8: ItemShouldDegradeInQualityTwiceAsFastAfterTheSellInDate

        public void ItemShouldDegradeInQualityTwiceAsFastAfterTheSellInDate()
        {
            IList<Item> items = new List<Item> { new Item { Name = "foo", SellIn = 0, Quality = 5 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "foo", SellIn = -1, Quality = 3 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs

示例9: ItemShouldDegradeInQuality

        public void ItemShouldDegradeInQuality()
        {
            IList<Item> items = new List<Item> { new Item { Name = "foo", SellIn = 10, Quality = 5 } };
            GildedRose app = new GildedRose(items);

            app.UpdateQuality();

            var expected = new Item { Name = "foo", SellIn = 9, Quality = 4 };
            expected.ShouldBeEquivalentTo(items[0]);
        }
开发者ID:riezebosch,项目名称:GildedRose-Refactoring-Kata,代码行数:10,代码来源:GildedRoseTest.cs


注:本文中的Item.ShouldBeEquivalentTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。