Inheritance: Spring.Data.Objects.AdoOperation
 public void DeclareParameterAfterCompile()
 {
     TestAdoOperation operation = new TestAdoOperation();
     operation.DbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient");
     operation.Sql = "select * from table";
     operation.Compile();
     IDbParameters parameters = new DbParameters(operation.DbProvider);
     Assert.Throws<InvalidDataAccessApiUsageException>(() => operation.DeclaredParameters = parameters);
 }
Ejemplo n.º 2
0
 public void DeclareParameterAfterCompile()
 {
     TestAdoOperation operation = new TestAdoOperation();
     operation.DbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient");
     operation.Sql = "select * from table";
     operation.Compile();
     IDbParameters parameters = new DbParameters(operation.DbProvider);
     operation.DeclaredParameters = parameters;
 }
 public void TooFewParameters()
 {
     TestAdoOperation operation = new TestAdoOperation();
     operation.DbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient");
     operation.Sql = "select * from table";
     IDbParameters parameters = new DbParameters(operation.DbProvider);
     parameters.Add("name");
     operation.DeclaredParameters = parameters;
     operation.Compile();
     Assert.Throws<InvalidDataAccessApiUsageException>(() => operation.ValidateParams(null));
 }
Ejemplo n.º 4
0
 public void TooFewParameters()
 {
     TestAdoOperation operation = new TestAdoOperation();
     operation.DbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient");
     operation.Sql = "select * from table";
     IDbParameters parameters = new DbParameters(operation.DbProvider);
     parameters.Add("name");
     operation.DeclaredParameters = parameters;
     operation.Compile();
     operation.ValidateParams(null);
 }
        public void DeclareParameterAfterCompile()
        {
            TestAdoOperation operation = new TestAdoOperation();

            operation.DbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient");
            operation.Sql        = "select * from table";
            operation.Compile();
            IDbParameters parameters = new DbParameters(operation.DbProvider);

            Assert.Throws <InvalidDataAccessApiUsageException>(() => operation.DeclaredParameters = parameters);
        }
        public void TooFewParameters()
        {
            TestAdoOperation operation = new TestAdoOperation();

            operation.DbProvider = DbProviderFactory.GetDbProvider("System.Data.SqlClient");
            operation.Sql        = "select * from table";
            IDbParameters parameters = new DbParameters(operation.DbProvider);

            parameters.Add("name");
            operation.DeclaredParameters = parameters;
            operation.Compile();
            Assert.Throws <InvalidDataAccessApiUsageException>(() => operation.ValidateParams(null));
        }
        public void EmptySql()
        {
            TestAdoOperation operation = new TestAdoOperation();

            operation.Compile();
        }
 public void EmptySql()
 {
     TestAdoOperation operation = new TestAdoOperation();
     Assert.Throws<InvalidDataAccessApiUsageException>(() => operation.Compile()); 
 }
Ejemplo n.º 9
0
 public void EmptySql()
 {
     TestAdoOperation operation = new TestAdoOperation();
     operation.Compile();           
 }
Ejemplo n.º 10
0
        public void EmptySql()
        {
            TestAdoOperation operation = new TestAdoOperation();

            Assert.Throws <InvalidDataAccessApiUsageException>(() => operation.Compile());
        }