public void ItShouldBePossibleToImplicitlyCastPositiveDecimalToNonNegativeDecimal() { var value = Extensions.GetValue(() => PositiveDecimal.TryCreate(1, (NonEmptyString)"Value")); NonNegativeDecimal castResult = value; castResult.ShouldBeOfType <NonNegativeDecimal>(); }
public void PositiveDecimalCannotBeCreatedFromNullValue() { var result = PositiveDecimal.TryCreate(null, (NonEmptyString)"Value"); result.IsSuccess.ShouldBeFalse(); }
public void PositiveDecimalCannotBeCreatedFromZeroOrNegativeValue([Values(-1, 0)] decimal value) { var result = PositiveDecimal.TryCreate(value, (NonEmptyString)"Value"); result.IsSuccess.ShouldBeFalse(); }
public void PositiveDecimalCanBeCreatedFromPosititiveValue() { var result = PositiveDecimal.TryCreate(1, (NonEmptyString)"Value"); result.IsSuccess.ShouldBeTrue(); }