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