public void ParseShouldParseIdentified() { string[] itemStringLines = this.itemStringBuilder .BuildLines(); JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem; Assert.IsTrue(result.IsIdentified); }
public void ParseShouldParseNotCorrupted() { string[] itemStringLines = this.itemStringBuilder .BuildLines(); JewelItem result = this.ItemParser.Parse(itemStringLines) as JewelItem; Assert.IsFalse(result.IsCorrupted); }
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); }
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)); }
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); }
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); }
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)); }