public void IsDecimal_WhenIsCorrectType_It_should_not_throw() => ShouldNotThrow( () => Ensure.Type.IsDecimal(typeof(decimal), ParamName), () => Ensure.Type.IsDecimal(42.33m, ParamName), () => EnsureArg.IsDecimal(typeof(decimal), ParamName), () => EnsureArg.IsDecimal(42.33m, ParamName), () => Ensure.ThatType(typeof(decimal), ParamName).IsDecimal(), () => Ensure.ThatTypeFor(42.33m, ParamName).IsDecimal());
public void IsDecimal_WhenNotTypeOf_ThrowsArgumentException() => AssertIsOfTypeScenario( typeof(decimal), typeof(int), () => Ensure.Type.IsDecimal(typeof(int), ParamName), () => Ensure.Type.IsDecimal(42, ParamName), () => EnsureArg.IsDecimal(typeof(int), ParamName), () => EnsureArg.IsDecimal(42, ParamName), () => Ensure.ThatType(typeof(int), ParamName).IsDecimal(), () => Ensure.ThatTypeFor(42, ParamName).IsDecimal());
public void IsDecimal_WhenIsCorrectType_It_should_not_throw() { var returnedValue = Ensure.ThatTypeFor(42.33m, ParamName).IsDecimal(); AssertReturnedAsExpected(returnedValue, typeof(decimal)); Action a = () => EnsureArg.IsDecimal(typeof(decimal), ParamName); a.ShouldNotThrow(); Action b = () => EnsureArg.IsDecimal(42.33m, ParamName); b.ShouldNotThrow(); }