Example #1
0
        public void IsNotNegativeOfTimeSpan_When_Argument_Is_Negative_One_Should_Throw_ArgumentException()
        {
            var ex = Assert.Throws <ArgumentException>(
                () => Invariant.IsNotNegative(TimeSpan.FromTicks(1).Negate(), PARAMETER_NAME));

            Assert.AreEqual($"Argument '{PARAMETER_NAME}' must not have a negative value.", ex.Message);
        }
Example #2
0
        public void IsNotNegativeOfDecimal_When_Argument_Is_Negative_One_Should_Throw_ArgumentException()
        {
            var ex = Assert.Throws <ArgumentException>(() => Invariant.IsNotNegative((decimal) - 1, PARAMETER_NAME));

            Assert.AreEqual($"Argument '{PARAMETER_NAME}' must not have a negative value.", ex.Message);
        }
Example #3
0
 public void IsNotNegativeOfTimeSpan_When_Argument_Is_Zero_Should_Not_Throw()
 {
     Assert.DoesNotThrow(() => Invariant.IsNotNegative(TimeSpan.Zero, PARAMETER_NAME));
 }
Example #4
0
 public void IsNotNegativeOfDecimal_When_Argument_Is_Zero_Should_Not_Throw()
 {
     Assert.DoesNotThrow(() => Invariant.IsNotNegative((decimal)0, PARAMETER_NAME));
 }