public void ExecutesTheStatement() { var expression = new ExecuteSqlStatementExpression() { SqlStatement = "INSERT INTO BLAH" }; var processor = new Mock<IMigrationProcessor>(); processor.Setup(x => x.Execute(expression.SqlStatement)).Verifiable(); expression.ExecuteWith(processor.Object); processor.Verify(); }
public void Sql(string sqlStatement) { var expression = new ExecuteSqlStatementExpression { SqlStatement = sqlStatement }; _context.Expressions.Add(expression); }
public void ToStringIsDescriptive() { var expression = new ExecuteSqlStatementExpression() { SqlStatement = "INSERT INTO BLAH" }; expression.ToString().ShouldBe("ExecuteSqlStatement INSERT INTO BLAH"); }
public void ErrorIsReturnWhenSqlStatementIsNullOrEmpty() { var expression = new ExecuteSqlStatementExpression() {SqlStatement = null}; var errors = ValidationHelper.CollectErrors(expression); errors.ShouldContain(ErrorMessages.SqlStatementCannotBeNullOrEmpty); }