示例#1
0
        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");
            }
        }
示例#2
0
        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");
            }
        }
示例#3
0
        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");
            }
        }
示例#4
0
        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}");
                }
            }
        }