public void TestAllPerksHaveDescriptions() { var perkCollection = new PerkCollectionForTest(); foreach (var perk in perkCollection.AllPerks) { Assert.That(!string.IsNullOrEmpty(perk.Description), $"Add a description for {perk.Name} Perk"); } }
public void TestXmlPerks() { var collection = new PerkCollectionForTest(); foreach (var perk in collection.AllPerks) { Assert.IsNotNull(PerkCollectionXMLReaderTestMethods.TestGetPerkFromCode(typeof(PerkCollection), perk.Code), $"Perk {perk.Code} will fail to import"); } }
public void TestAllSoulsAreInSoulCollection() { var perkCollection = new PerkCollectionForTest(); var allPerkPropertyInfos = typeof(PerkCollection).GetProperties().Where(p => p.PropertyType == typeof(VPerk)); foreach (var property in allPerkPropertyInfos) { var actualPerk = property.GetValue(perkCollection); Assert.That(perkCollection.AllPerks.Contains(actualPerk), $"{actualPerk.GetType().Name} wasn't found in AllPerks"); } }
public void TestPerksPageAndPostions() { var lastPage = Enums.GetValues <PlayerRank>().Last().GetMaxPerkPage(); var perkCollection = new PerkCollectionForTest(); for (var i = 0; i < lastPage; i++) { for (var j = 0; j < 6; j++) { var matchingPerks = perkCollection.AllPerks.Where(p => p.Position == j + 1 && p.Page == i + 1).ToList(); Assert.That(matchingPerks, Has.Count.EqualTo(1), $"Fail at Page {i+1} and Position {j+1}"); } } }