Example #1
0
        public void GenerateAcceptableNullableDecimalReturnsExpectedResult()
        {
            var fieldValue = _fixture.Create <DbaseDecimal>();

            var value = _sut.GenerateAcceptableValue(fieldValue);

            _output.WriteLine(
                "Generated value {0} for field with length {1}, positive digits {2}, negative digits {3} and decimals {4}.",
                value.HasValue
                    ? value.Value.ToString("F", new NumberFormatInfo {
                NumberDecimalDigits = fieldValue.Field.DecimalCount.ToInt32(), NumberDecimalSeparator = "."
            })
                    : "null",
                fieldValue.Field.Length,
                fieldValue.Field.PositiveIntegerDigits,
                fieldValue.Field.NegativeIntegerDigits,
                fieldValue.Field.DecimalCount);

            Assert.True(fieldValue.AcceptsValue(value));
        }
 public void Visit(DbaseDecimal value)
 {
     value.Value = _generator.GenerateAcceptableValue(value);
 }