コード例 #1
0
        public void ParseShouldParseIdentified()
        {
            string[] itemStringLines = this.itemStringBuilder
                                       .BuildLines();

            JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem;

            Assert.IsTrue(result.IsIdentified);
        }
コード例 #2
0
        public void ParseShouldParseNotCorrupted()
        {
            string[] itemStringLines = this.itemStringBuilder
                                       .BuildLines();

            JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem;

            Assert.IsFalse(result.IsCorrupted);
        }
コード例 #3
0
        public void ParseShouldParseRarity(ItemRarity expected)
        {
            string[] itemStringLines = this.itemStringBuilder
                                       .WithRarity(expected)
                                       .BuildLines();

            JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem;

            Assert.That(result.Rarity, Is.EqualTo(expected));
        }
        public void CreateShouldReturnCorruptedFilterViewModel(bool value)
        {
            Expression <Func <SearchQueryRequest, IFilter> > expectedBindingExpression = x => x.Query.Filters.MiscFilters.Corrupted;
            var jewelItem = new JewelItem(ItemRarity.Rare)
            {
                IsCorrupted = value
            };

            this.CreateShouldReturnBindableFilterViewModel(expectedBindingExpression, jewelItem, null, Resources.Corrupted);
        }
コード例 #5
0
        public void ParseShouldParseNameOfMagicJewel()
        {
            const string expected = "Pyromantic Cobalt Jewel";

            string[] itemStringLines = this.itemStringBuilder
                                       .WithRarity(ItemRarity.Magic)
                                       .WithName(expected)
                                       .BuildLines();

            JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem;

            Assert.That(result.Name, Is.EqualTo(expected));
        }
コード例 #6
0
        protected override ItemWithStats ParseItemWithoutStats(string[] itemStringLines)
        {
            ItemRarity?rarity    = this.GetRarity(itemStringLines);
            var        jewelItem = new JewelItem(rarity.Value)
            {
                Name         = itemStringLines[NameLineIndex],
                IsIdentified = this.IsIdentified(itemStringLines),
                IsCorrupted  = this.IsCorrupted(itemStringLines)
            };

            jewelItem.Type = this.itemTypeParser.ParseType(itemStringLines, jewelItem.Rarity, jewelItem.IsIdentified);

            return(jewelItem);
        }
コード例 #7
0
        public void ParseShouldParseNameOfRareIdentifiedJewel(ItemRarity itemRarity)
        {
            const string expected = "Armageddon Joy";

            string[] itemStringLines = this.itemStringBuilder
                                       .WithRarity(itemRarity)
                                       .WithName(expected)
                                       .WithType("Cobalt Jewel")
                                       .BuildLines();

            JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem;

            Assert.That(result.Name, Is.EqualTo(expected));
        }
        public void CreateShouldReturnCorruptedFilterViewModelWithValueFromQueryRequest()
        {
            Expression <Func <SearchQueryRequest, IFilter> > expectedBindingExpression = x => x.Query.Filters.MiscFilters.Corrupted;
            var jewelItem = new JewelItem(ItemRarity.Rare)
            {
                IsCorrupted = true
            };

            var queryRequestFilter = new BoolOptionFilter
            {
                Option = false
            };

            this.CreateShouldReturnBindableFilterViewModelWithValueFromQueryRequest(expectedBindingExpression, jewelItem, Resources.Corrupted, queryRequestFilter);
        }
コード例 #9
0
        public void ParseShouldSetTypeFromItemTypeParser(ItemRarity itemRarity, bool isIdentified)
        {
            const string expected = "Result from ItemTypeParser";

            string[] itemStringLines = this.itemStringBuilder
                                       .WithRarity(itemRarity)
                                       .WithIdentified(isIdentified)
                                       .WithName("Cobalt Jewel")
                                       .BuildLines();

            this.itemTypeParserMock.Setup(x => x.ParseType(itemStringLines, itemRarity, isIdentified))
            .Returns(expected);

            JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem;

            Assert.That(result.Type, Is.EqualTo(expected));
        }