I want substituting IDBCommand with using NSubstitue. I must substitue field CommandText, and I did
string settedCommandText=string.Empty;
IDbCommand fakeCommand = Substitute.For<IDbCommand>();
command.CommandText =Arg.Do<string>(x => settedCommandText = x);
All right, but compiler throw error:
CA2100 The query string passed to 'IDbCommand.CommandText.set(string)' in 'DriverTest.RevertCommandSendRevertInstruction()' could contain the following variables 'Arg.Do(...)'. If any of these variables could come from user input, consider using a stored procedure or a parameterized SQL query instead of building the query with string concatenations.
How can I rewrite this code without suppressing this error. I don't want use System.Diagnostics.CodeAnalysis.SuppressMessage