public void ThrowsForAnUnmarkedProperty() { var simpleProperty = typeof(TestDBCRecordWithArray).GetProperties() .First(p => p.Name == nameof(TestDBCRecordWithArray.SimpleField)); Assert.Throws <ArgumentException>(() => DBCInspector.GetVersionRelevantPropertyFieldArrayAttribute(WarcraftVersion.Classic, simpleProperty)); }
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); }
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); }