예제 #1
0
            public void ThrowsForAnUnmarkedProperty()
            {
                var simpleProperty = typeof(TestDBCRecordWithArray).GetProperties()
                                     .First(p => p.Name == nameof(TestDBCRecordWithArray.SimpleField));

                Assert.Throws <ArgumentException>(() => DBCInspector.GetVersionRelevantPropertyFieldArrayAttribute(WarcraftVersion.Classic, simpleProperty));
            }
예제 #2
0
            public void ReturnsAValidAttributeForAMarkedProperty()
            {
                var arrayProperty = typeof(TestDBCRecordWithArray).GetProperties()
                                    .First(p => p.Name == nameof(TestDBCRecordWithArray.ArrayField));

                RecordFieldAttribute attribute = null;

                Assert.DoesNotThrow(() => attribute = DBCInspector.GetVersionRelevantPropertyFieldArrayAttribute(WarcraftVersion.Classic, arrayProperty));

                Assert.AreEqual(WarcraftVersion.Classic, attribute.IntroducedIn);
            }
예제 #3
0
            public void ReturnsCorrectAttributeForPropertyWithMultipleAttributes()
            {
                var arrayProperty = typeof(TestDBCRecordWithVersionedArray).GetProperties()
                                    .First(p => p.Name == nameof(TestDBCRecordWithVersionedArray.VersionedArray));

                var classicAttribute =
                    DBCInspector.GetVersionRelevantPropertyFieldArrayAttribute(WarcraftVersion.Classic, arrayProperty);

                var wrathAttribute =
                    DBCInspector.GetVersionRelevantPropertyFieldArrayAttribute(WarcraftVersion.Wrath, arrayProperty);

                var cataAttribute =
                    DBCInspector.GetVersionRelevantPropertyFieldArrayAttribute(WarcraftVersion.Cataclysm, arrayProperty);

                Assert.AreEqual(2, classicAttribute.Count);
                Assert.AreEqual(4, wrathAttribute.Count);
                Assert.AreEqual(6, cataAttribute.Count);
            }