コード例 #1
0
        public void LessThan()
        {
            int minValue = 1;
            int value    = 2;

            Assert.ThrowsExact <ArgumentNullException>(() => Assert.LessThan <string>(null, "z"));
            Assert.ThrowsExact <ArgumentNullException>(() => Assert.LessThan <string>("a", null));
            Assert.ThrowsExact <AssertionException>(() => Assert.LessThan(value, minValue));
            Assert.ThrowsExact <AssertionException>(() => Assert.LessThan(minValue, minValue));
            Assert.DoesNotThrow(() => Assert.LessThan(minValue - 5, minValue));
            Assert.ThrowsExact <AssertionException>(() => Assert.LessThan(minValue + 5, minValue));
        }