Ejemplo n.º 1
0
        public void CannotSetPrecisionAbove38()
        {
            // Arrange
            var r = new DecimalPrecisionRule("ARuleName").Property("APropertyName");

            // Act
            r.Precision(39);
        }
Ejemplo n.º 2
0
        public void CannotSetPrecisionToNegativeValue()
        {
            // Arrange
            var r = new DecimalPrecisionRule("ARuleName").Property("APropertyName");

            // Act
            r.Precision(-10);
        }
Ejemplo n.º 3
0
        public void CannotSetPecisionToZero()
        {
            // Arrange
            var r = new DecimalPrecisionRule("ARuleName").Property("APropertyName");

            // Act
            r.Precision(0);
        }
Ejemplo n.º 4
0
        public void CannotSetPrecisionWhenPropertyNotSet()
        {
            // Arrange
            var r = new DecimalPrecisionRule("ARuleName");

            // Act
            r.Precision(10);
        }
Ejemplo n.º 5
0
        public void PrecisionCanBeSetTo38Precisely()
        {
            // Arrange
            var r = new DecimalPrecisionRule("ARuleName").Property("APropertyName");

            // Act
            r.Precision(38);

            // Assert
            Assert.IsTrue(r.PrecisionValue.HasValue);
            Assert.AreEqual(38, r.PrecisionValue.Value);
        }
Ejemplo n.º 6
0
        public void PrecisionSetsPrecision()
        {
            // Arrange
            var r = new DecimalPrecisionRule("ARuleName").Property("APropertyName");

            // Act
            r.Precision(6);

            // Assert
            Assert.IsTrue(r.PrecisionValue.HasValue);
            Assert.AreEqual(6, r.PrecisionValue.Value);
        }