public void ParseShouldCallParseOnItemStatsParserWithPreferLocalStats(EquippableItemCategory itemCategory, bool expectedPreferLocalStats) { string[] itemStringLines = this.itemStringBuilder .WithType("Thicket Bow") .BuildLines(); this.itemDataServiceMock.Setup(x => x.GetCategory(It.IsAny <string>())) .Returns(itemCategory.GetDisplayName()); this.ItemParser.Parse(itemStringLines); this.itemStatsParserMock.Verify(x => x.Parse(itemStringLines, expectedPreferLocalStats)); }
public void ParseShouldSetCategoryFromItemDataService(EquippableItemCategory?itemCategory, EquippableItemCategory expectedItemCategory) { // arrange string[] itemStringLines = this.itemStringBuilder.BuildLines(); this.itemDataServiceMock.Setup(x => x.GetCategory(It.IsAny <string>())) .Returns(itemCategory?.GetDisplayName().ToLower()); // act EquippableItem result = this.ItemParser.Parse(itemStringLines) as EquippableItem; // assert Assert.That(result.Category, Is.EqualTo(expectedItemCategory)); }