Ejemplo n.º 1
0
        public void ItShouldBePossibleToImplicitlyCastPositiveDecimalToNonNegativeDecimal()
        {
            var value = Extensions.GetValue(() => PositiveDecimal.TryCreate(1, (NonEmptyString)"Value"));
            NonNegativeDecimal castResult = value;

            castResult.ShouldBeOfType <NonNegativeDecimal>();
        }
Ejemplo n.º 2
0
        public void PositiveDecimalCannotBeCreatedFromNullValue()
        {
            var result = PositiveDecimal.TryCreate(null, (NonEmptyString)"Value");

            result.IsSuccess.ShouldBeFalse();
        }
Ejemplo n.º 3
0
        public void PositiveDecimalCannotBeCreatedFromZeroOrNegativeValue([Values(-1, 0)] decimal value)
        {
            var result = PositiveDecimal.TryCreate(value, (NonEmptyString)"Value");

            result.IsSuccess.ShouldBeFalse();
        }
Ejemplo n.º 4
0
        public void PositiveDecimalCanBeCreatedFromPosititiveValue()
        {
            var result = PositiveDecimal.TryCreate(1, (NonEmptyString)"Value");

            result.IsSuccess.ShouldBeTrue();
        }