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