Ejemplo n.º 1
0
        public void MustBeGreaterThan_IsLessOrEqual_ThrowsNoException(int value, int min)
        {
            ArgumentOutOfRangeException exception = Assert.Throws <ArgumentOutOfRangeException>(
                () => DebugGuard.MustBeGreaterThan(value, min, "myParamName"));

            Assert.Equal("myParamName", exception.ParamName);
            Assert.Contains($"Value {value} must be greater than {min}.", exception.Message);
        }
Ejemplo n.º 2
0
        public void MustBeSizedAtLeast_Array_LengthIsLess_ThrowsException()
        {
            ArgumentException exception = Assert.Throws <ArgumentException>(
                () => DebugGuard.MustBeSizedAtLeast <int>(new int[] { 1, 2 }, 3, "myParamName"));

            Assert.Equal("myParamName", exception.ParamName);
            Assert.Contains($"The size must be at least 3.", exception.Message);
        }
Ejemplo n.º 3
0
        public void MustBeGreaterThanOrEqualTo_IsLess_ThrowsNoException()
        {
            ArgumentOutOfRangeException exception = Assert.Throws <ArgumentOutOfRangeException>(
                () => DebugGuard.MustBeGreaterThanOrEqualTo(1, 2, "myParamName"));

            Assert.Equal("myParamName", exception.ParamName);
            Assert.Contains($"Value 1 must be greater than or equal to 2.", exception.Message);
        }
Ejemplo n.º 4
0
 public void MustBeSizedAtLeast_Array_LengthIsGreaterOrEqual_ThrowsNoException(int[] value, int minLength)
 {
     DebugGuard.MustBeSizedAtLeast <int>(value, minLength, "myParamName");
 }
Ejemplo n.º 5
0
 public void MustBeGreaterThanOrEqualTo_IsGreaterOrEqual_ThrowsNoException(int value, int min)
 {
     DebugGuard.MustBeGreaterThanOrEqualTo(value, min, "myParamName");
 }
Ejemplo n.º 6
0
 public void MustBeGreaterThan_IsGreater_ThrowsNoException()
 {
     DebugGuard.MustBeGreaterThan(2, 1, "myParamName");
 }
Ejemplo n.º 7
0
        public void MustBeLessThanOrEqualTo_IsGreater_ThrowsNoException()
        {
            ArgumentOutOfRangeException exception = Assert.Throws <ArgumentOutOfRangeException>(() => DebugGuard.MustBeLessThanOrEqualTo(2, 1, "myParamName"));

            Assert.Equal("myParamName", exception.ParamName);
            Assert.Contains($"Value 2 must be less than or equal to 1.", exception.Message);
        }
Ejemplo n.º 8
0
 public void MustBeLessThanOrEqualTo_IsLessOrEqual_ThrowsNoException(int value, int max)
 {
     DebugGuard.MustBeLessThanOrEqualTo(value, max, "myParamName");
 }
Ejemplo n.º 9
0
 public void MustBeLessThan_IsLess_ThrowsNoException()
 {
     DebugGuard.MustBeLessThan(0, 1, "myParamName");
 }