Beispiel #1
0
 public void WhenParamIsGreaterThanValue_ThenThrowException()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((sbyte)2, (sbyte)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((byte)2, (byte)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((short)2, (short)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((ushort)2, (ushort)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((int)2, (int)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((uint)2, (uint)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((long)2, (long)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan((ulong)2, (ulong)1));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan(2.0f, 1.0f));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan(2.0d, 1.0d));
     Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.LessThan(2.0M, 1.0M));
 }
Beispiel #2
0
 public void WhenParamIsLessThanValue_ThenDoNotThrowException()
 {
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((sbyte)1, (sbyte)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((byte)1, (byte)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((short)1, (short)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((ushort)1, (ushort)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((int)1, (int)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((uint)1, (uint)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((long)1, (long)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan((ulong)1, (ulong)2));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan(1.0f, 2.0f));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan(1.0d, 2.0d));
     Assert.DoesNotThrow(() => ArgMustBe.LessThan(1.0M, 2.0M));
 }