public void WhenParamIsLessThanValue_ThenThrowException() { Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((sbyte)1, (sbyte)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((byte)1, (byte)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((short)1, (short)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((ushort)1, (ushort)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((int)1, (int)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((uint)1, (uint)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((long)1, (long)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan((ulong)1, (ulong)2)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan(1.0f, 2.0f)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan(1.0d, 2.0d)); Assert.Throws <ArgumentOutOfRangeException>(() => ArgMustBe.GreaterThan(1.0M, 2.0M)); }
public void WhenParamIsGreaterThanValue_ThenDoNotThrowException() { Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((sbyte)2, (sbyte)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((byte)2, (byte)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((short)2, (short)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((ushort)2, (ushort)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((int)2, (int)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((uint)2, (uint)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((long)2, (long)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan((ulong)2, (ulong)1)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan(2.0f, 1.0f)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan(2.0d, 1.0d)); Assert.DoesNotThrow(() => ArgMustBe.GreaterThan(2.0M, 1.0M)); }