Example #1
0
 public void InvalidSizeTest(SpannerDbType spannerType, int size)
 {
     if (size == -1)
     {
         Assert.Throws <ArgumentOutOfRangeException>(
             () => new SpannerParameter {
             SpannerDbType = spannerType.WithSize(size)
         });
     }
     else
     {
         Assert.Throws <InvalidOperationException>(
             () => new SpannerParameter {
             SpannerDbType = spannerType.WithSize(size)
         });
     }
 }
Example #2
0
        public void SizeTest(SpannerDbType spannerType, int size)
        {
            var parameter = new SpannerParameter {
                SpannerDbType = spannerType.WithSize(size)
            };

            Assert.Equal(parameter.Size, size);
            Assert.Equal(parameter.SpannerDbType.TypeCode, spannerType.TypeCode);

            parameter = new SpannerParameter
            {
                SpannerDbType = spannerType,
                Size          = size
            };
            Assert.Equal(parameter.Size, size);
            Assert.Equal(parameter.SpannerDbType.TypeCode, spannerType.TypeCode);
        }