Exemple #1
0
        public void ValidateUnnamedDefaultConstraintDropsBehavior_NoErrors(bool commentOut, bool replace)
        {
            // Arrange
            var model = new ConfigurationModel
            {
                CommentOutUnnamedDefaultConstraintDrops = commentOut,
                ReplaceUnnamedDefaultConstraintDrops    = replace
            };

            // Act
            var errors = ConfigurationModelValidations.ValidateUnnamedDefaultConstraintDropsBehavior(model);

            // Assert
            Assert.IsNotNull(errors);
            Assert.AreEqual(0, errors.Count);
        }
Exemple #2
0
        public void ValidateUnnamedDefaultConstraintDropsBehavior_Errors_BothSetToTrue()
        {
            // Arrange
            var model = new ConfigurationModel
            {
                CommentOutUnnamedDefaultConstraintDrops = true,
                ReplaceUnnamedDefaultConstraintDrops    = true
            };

            // Act
            var errors = ConfigurationModelValidations.ValidateUnnamedDefaultConstraintDropsBehavior(model);

            // Assert
            Assert.IsNotNull(errors);
            Assert.AreEqual(1, errors.Count);
            Assert.AreEqual("Behavior for unnamed default constraint drops is ambiguous.", errors[0]);
        }
Exemple #3
0
 public void ValidateUnnamedDefaultConstraintDropsBehavior_ArgumentNullException_Model()
 {
     // Act & Assert
     // ReSharper disable once AssignNullToNotNullAttribute
     Assert.Throws <ArgumentNullException>(() => ConfigurationModelValidations.ValidateUnnamedDefaultConstraintDropsBehavior(null));
 }