Example #1
0
        public void TestThrowIfNegativeWithoutFieldName([Values(-1)] int value)
        {
            ArgumentOutOfRangeException ex = Assert.Throws <ArgumentOutOfRangeException>(() => ValidationUtil.ThrowIfNegative(value, null));

            Assert.NotNull(ex);
            Assert.True(ex.Message.StartsWith("Cannot be negative."));
            Assert.AreEqual(string.Empty, ex.ParamName);
        }