public void Constructor_DefaultDecimalPlaces(Int32 precision) { // Act var attribute = new SingleComparisonAttribute(precision); // Assert Assert.Equal(precision, attribute.Precision); Assert.Equal(PrecisionStyle.DecimalPlaces, attribute.PrecisionStyle); }
public void Constructor_SupportedPrecisions(Int32 precision, PrecisionStyle precisionStyle) { // Act var attribute = new SingleComparisonAttribute(precision, precisionStyle); // Assert Assert.Equal(precision, attribute.Precision); Assert.Equal(precisionStyle, attribute.PrecisionStyle); }
private static Boolean TryGetAttribute( MemberInfo member, out SingleComparisonAttribute attribute) { attribute = member .GetCustomAttributes(typeof(SingleComparisonAttribute), inherit: true) .Cast <SingleComparisonAttribute>() .SingleOrDefault(); return(attribute != null); }