I have managed to successfully mock a query using:
var conn = new Apps72.Dev.Data.DbMocker.MockDbConnection();
conn.Mocks
.When(cmd => cmd.CommandText.StartsWith("SELECT 1 FROM "))
.ReturnsScalar<int>(1);
Then in one method I have the following query that matches teh command text:
command.CommandText = "SELECT 1 FROM " + this.headerTable + " WHERE JobID='" + this.jobId '";
int result = command.ExecutNonQuery();
But then further down in teh same method I have
command.CommandText = "SELECT 2 FROM " + this.headerTable + " WHERE JobID='" + this.jobId '";
int result = command.ExecutNonQuery();
How can I add a mock result for startswith("Select 2 from")
Regards
I have managed to successfully mock a query using:
Then in one method I have the following query that matches teh command text:
But then further down in teh same method I have
How can I add a mock result for startswith("Select 2 from")
Regards