Writing xUnit Tests in .NET Core

RE: Writing xUnit Tests in .NET Core — Visual Studio Magazine

Very nice example and explanations!
They even show how to pass in multiple values to test with.

Thank you!

C# Enum.Description() extension method

        /// 
/// Returns the text of the [Description("text")] attribute on an enum. Or null if not found.
///

///
///
[ CanBeNull ]
public static String Description( this Enum element ) {
var type = element.GetType();

var memberInfo = type.GetMember( element.ToString() );

if ( !memberInfo.Any() ) {
return null;
}
var attributes = memberInfo[ 0 ].GetCustomAttributes( typeof( DescriptionAttribute ), false );

return attributes.Any() ? ( attributes[ 0 ] as DescriptionAttribute )?.Description : null;
}