Exemplo n.º 1
0
        public void HexaDecimalArgumentOutOfError(uint value, int groupSize, int minDigits, string paramName, string message)
        {
            var ex = Assert.Throws <ArgumentOutOfRangeException>(paramName,
                                                                 () =>
            {
                var csharp = new CSharpHelper();
                csharp.HexaDecimal(value, groupSize, minDigits);
            });

            Assert.Equal(message + $"\r\nParameter name: {paramName}", ex.Message);
        }
Exemplo n.º 2
0
 public void HexaDecimalError(short value, int groupSize, int minDigits, Type exceptionType, string paramName, string message)
 {
     Assert.Throws(exceptionType,
                   () =>
     {
         try
         {
             var csharp = new CSharpHelper();
             csharp.HexaDecimal(value, groupSize, minDigits);
         }
         catch (ArgumentException ex)
         {
             Assert.Equal(paramName, ex.ParamName);
             Assert.Equal(message + $"\r\nParameter name: {paramName}", ex.Message);
             throw;
         }
     });
 }
Exemplo n.º 3
0
        public void HexaDecimal(string expected, short value, int groupSize, int minDigits)
        {
            var csharp = new CSharpHelper();

            Assert.Equal(expected, csharp.HexaDecimal(value, groupSize, minDigits));
        }