Пример #1
0
        public void TestGetColumnTypeDescription_When_PrecisionAndScale()
        {
            var colDesc = _xmlConversionsReader.GetColumnTypeDescription(ConversionXmlHelper.OracleBool());

            colDesc.TypeName.Should().Be("number", "because type name is number");
            colDesc.ConvertTo.Should().Be("bool", "because number(1,0) should be bool");
            colDesc.Constraints.Count.Should().Be(2, "because we should have Precision and Scale");

            colDesc.Constraints[0].ConstraintType.Should().Be("Prec");
            colDesc.Constraints[0].Operator.OperatorName.Should().Be(TypeOperatorName.Eq);
            colDesc.Constraints[0].Operator.ConstraintValues.Count.Should().Be(1, "because there is only one value for Precision constraint");
            colDesc.Constraints[0].Operator.ConstraintValues[0].Should().Be(1, "because Bool has a precision of 1");

            colDesc.Constraints[1].ConstraintType.Should().Be("Scale");
            colDesc.Constraints[1].Operator.OperatorName.Should().Be(TypeOperatorName.Eq);
            colDesc.Constraints[1].Operator.ConstraintValues.Count.Should().Be(1, "because there is only one value for Scale constraint");
            colDesc.Constraints[1].Operator.ConstraintValues[0].Should().Be(0, "because Bool has a Scale of 0");
        }