private void CheckAttributeInheritance(IOwnCustomAttributeDataProvider ownAttributeDataProvider, ICustomAttributeProvider attributeProvider) { var actualNonInheritableAttributes = ownAttributeDataProvider.GetCustomAttributes(false); var actualInheritableAttributes = ownAttributeDataProvider.GetCustomAttributes(true); var expectedNonInheritableAttributes = attributeProvider.GetCustomAttributes(false); var expectedInheritableAttributes = attributeProvider.GetCustomAttributes(true); Comparison <object> typeComparer = (a, b) => a.GetType() == b.GetType() ? 0 : -1; Assert.That(actualNonInheritableAttributes, Is.EqualTo(expectedNonInheritableAttributes).Using(typeComparer)); Assert.That(actualInheritableAttributes, Is.EqualTo(expectedInheritableAttributes).Using(typeComparer)); }
private void CheckIsDefinedInheritance(IOwnCustomAttributeDataProvider ownAttributeDataProvider) { Assert.That(ownAttributeDataProvider.IsDefined(typeof(InheritableAttribute), true), Is.True); Assert.That(ownAttributeDataProvider.IsDefined(typeof(NonInheritableAttribute), true), Is.False); }