/// <summary> /// Tries to query the categories. /// </summary> /// <param name="element">The element.</param> /// <param name="names">The names.</param> /// <returns>True if found.</returns> protected override bool TryGetCategories( ICustomAttributeProviderEx element, out IEnumerable <string> names) { names = null; return(false); }
/// <summary> /// Tries the read expected exception. /// </summary> /// <param name="target"> /// The method. /// </param> /// <param name="exceptionType"> /// Type of the exception. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public override bool TryReadExpectedException(ICustomAttributeProviderEx target, out TypeEx exceptionType) { var attribute = AttributeHelper.GetAttribute(target, ExpectedExceptionAttribute); if (attribute != null) { var attributeType = attribute.GetType(); // read exception type using reflection. var field = attributeType.GetField("expectedException", BindingFlags.NonPublic | BindingFlags.Instance); if (field != null) { var t = field.GetValue(attribute) as Type; bool isClass; if (t != null && ReflectionHelper.TryGetIsClass(t, out isClass) && isClass && !ReflectionHelper.ContainsGenericParameters(t)) { exceptionType = MetadataFromReflection.GetType(t); return(true); } } } exceptionType = null; return(false); }
/// <summary> /// Tries the get categories. /// </summary> /// <param name="element"> /// The element. /// </param> /// <param name="names"> /// The names. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> protected override bool TryGetCategories(ICustomAttributeProviderEx element, out IEnumerable <string> names) { SafeDebug.AssumeNotNull(element, "element"); // TODO names = null; return(false); }
/// <summary> /// Tries the read expected exception. /// </summary> /// <param name="target"> /// The method. /// </param> /// <param name="exceptionType"> /// Type of the exception. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public override bool TryReadExpectedException(ICustomAttributeProviderEx target, out TypeEx exceptionType) { exceptionType = null; return(false); }
protected override bool TryGetCategories( ICustomAttributeProviderEx element, out IEnumerable<string> names) { names = new string[] { }; return false; }
/// <summary> /// Tries the get categories. /// </summary> /// <param name="element"> /// The element. /// </param> /// <param name="names"> /// The names. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> protected override bool TryGetCategories(ICustomAttributeProviderEx element, out IEnumerable<string> names) { SafeDebug.AssumeNotNull(element, "element"); // TODO names = null; return false; }
/// <summary> /// Tries the read expected exception. /// </summary> /// <param name="target"> /// The method. /// </param> /// <param name="exceptionType"> /// Type of the exception. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public override bool TryReadExpectedException(ICustomAttributeProviderEx target, out TypeEx exceptionType) { var attribute = AttributeHelper.GetAttribute(target, ExpectedExceptionAttribute); if (attribute != null) { var attributeType = attribute.GetType(); // read exception type using reflection. var field = attributeType.GetField("expectedException", BindingFlags.NonPublic | BindingFlags.Instance); if (field != null) { var t = field.GetValue(attribute) as Type; bool isClass; if (t != null && ReflectionHelper.TryGetIsClass(t, out isClass) && isClass && !ReflectionHelper.ContainsGenericParameters(t)) { exceptionType = MetadataFromReflection.GetType(t); return true; } } } exceptionType = null; return false; }
/// <inheritdoc/> public override bool TryReadExpectedException(ICustomAttributeProviderEx target, out TypeEx exceptionType) { // xUnit.net does not have an [ExpectedException] attribute exceptionType = null; return false; }
/// <summary> /// Tries the read expected exception. /// </summary> /// <param name="target"> /// The method. /// </param> /// <param name="exceptionType"> /// Type of the exception. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public override bool TryReadExpectedException(ICustomAttributeProviderEx target, out TypeEx exceptionType) { exceptionType = null; return false; }
/// <inheritdoc/> public override bool TryReadExpectedException(ICustomAttributeProviderEx target, out TypeEx exceptionType) { // xUnit.net does not have an [ExpectedException] attribute exceptionType = null; return(false); }