Пример #1
0
        /// <summary>Initializes a new instance of the <see cref="CHAR" /> struct.</summary>
        /// <param name="value">The value of the instance.</param>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="value" /> is greater than <see cref="byte.MaxValue" />.</exception>
        public CHAR(char value)
        {
            if (value > byte.MaxValue)
            {
                ExceptionUtilities.ThrowArgumentOutOfRangeException(nameof(value), value);
            }

            _value = (byte)(value);
        }
 public static void ThrowArgumentOutOfRangeExceptionStringObjectTest(
     [Values(null, "", "param")] string paramName,
     [Values(null, "", "value")] object value
     )
 {
     Assert.That(() => ExceptionUtilities.ThrowArgumentOutOfRangeException(paramName, value),
                 Throws.InstanceOf <ArgumentOutOfRangeException>()
                 .With.Property("ParamName").EqualTo(paramName)
                 .And.With.Property("ActualValue").EqualTo(value)
                 );
 }