private static IEnumerable <TestCaseData> NonQueryProcedureFormatCases() { yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text"), new SqlNonQueryCommand("text", new DbParameter[0], CommandType.StoredProcedure))); yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text", parameters: null), new SqlNonQueryCommand("text", new DbParameter[0], CommandType.StoredProcedure))); yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text", new IDbParameterValue[0]), new SqlNonQueryCommand("text", new DbParameter[0], CommandType.StoredProcedure))); yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text", new SqlParameterValueStub()), new SqlNonQueryCommand("text", new[] { new SqlParameterValueStub().ToDbParameter("@P0") }, CommandType.StoredProcedure))); yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text {0}", new SqlParameterValueStub()), new SqlNonQueryCommand("text @P0", new[] { new SqlParameterValueStub().ToDbParameter("@P0") }, CommandType.StoredProcedure))); yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text", new SqlParameterValueStub(), new SqlParameterValueStub()), new SqlNonQueryCommand("text", new[] { new SqlParameterValueStub().ToDbParameter("@P0"), new SqlParameterValueStub().ToDbParameter("@P1") }, CommandType.StoredProcedure))); yield return(new TestCaseData( TSql.NonQueryProcedureFormat("text {0} {1}", new SqlParameterValueStub(), new SqlParameterValueStub()), new SqlNonQueryCommand("text @P0 @P1", new[] { new SqlParameterValueStub().ToDbParameter("@P0"), new SqlParameterValueStub().ToDbParameter("@P1") }, CommandType.StoredProcedure))); }
public void NonQueryProcedureFormatParameterCountLimitedTo2098() { Assert.Throws <ArgumentException>(() => TSql.NonQueryProcedureFormat("", ParameterCountLimitedExceeded.Instance.All)); }