public void FindCollectionOf_ReturnsInnerResult() { mockInnerSelector .Setup(s => s.FindCollectionOf("my table", "my entry", "collection 1", "collection 2")) .Returns("my collection"); var result = proxy.FindCollectionOf("my table", "my entry", "collection 1", "collection 2"); Assert.That(result, Is.EqualTo("my collection")); }
private string GetRodName(string itemName) { var rods = RodConstants.GetAllRods(); if (rods.Contains(itemName)) { return(itemName); } var rodFromBaseName = collectionsSelector.FindCollectionOf(TableNameConstants.Collections.Set.ItemGroups, itemName, rods.ToArray()); return(rodFromBaseName); }
private string GetStaffName(string itemName) { var staffs = StaffConstants.GetAllStaffs(); if (staffs.Contains(itemName)) { return(itemName); } var staffFromBaseName = collectionsSelector.FindCollectionOf(TableNameConstants.Collections.Set.ItemGroups, itemName, staffs.ToArray()); return(staffFromBaseName); }
public int GenerateBaseAttackBonus(CreatureType creatureType, HitPoints hitPoints) { if (hitPoints.RoundedHitDiceQuantity == 0) { return(0); } var baseAttackQuality = collectionSelector.FindCollectionOf(TableNameConstants.Collection.CreatureGroups, creatureType.Name, GroupConstants.GoodBaseAttack, GroupConstants.AverageBaseAttack, GroupConstants.PoorBaseAttack); switch (baseAttackQuality) { case GroupConstants.GoodBaseAttack: return(GetGoodBaseAttackBonus(hitPoints.RoundedHitDiceQuantity)); case GroupConstants.AverageBaseAttack: return(GetAverageBaseAttackBonus(hitPoints.RoundedHitDiceQuantity)); case GroupConstants.PoorBaseAttack: return(GetPoorBaseAttackBonus(hitPoints.RoundedHitDiceQuantity)); default: throw new ArgumentException($"{creatureType.Name} has no base attack"); } }
public string FindCollectionOf(string tableName, string entry, params string[] filteredCollectionNames) { return(innerSelector.FindCollectionOf(tableName, entry, filteredCollectionNames)); }
public void FindCollectionOfNameFromTable() { var collectionName = collectionsSelector.FindCollectionOf("CollectionTable", "entry 3", "collection", "sub-collection"); Assert.That(collectionName, Is.EqualTo("collection")); }