-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
questionFurther information is requestedFurther information is requested
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested