public void ValidateMissingPKValue() { var a = new TableA(); a.FirstName = "whatever"; using (var cn = new PostulateDb().GetConnection()) { cn.Open(); var errs = a.GetValidationErrors(cn, SaveAction.Insert); Assert.IsTrue(errs.Any(item => item.Equals("Primary key field LastName requires a value."))); } }