Exemplo n.º 1
0
        public static IEnumerable <TestCaseData> NonQueryStatementIfCases()
        {
            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(true, "text"),
                             new[] { new SqlNonQueryCommand("text", new DbParameter[0], CommandType.Text) }));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(true, "text", parameters: null),
                             new[] { new SqlNonQueryCommand("text", new DbParameter[0], CommandType.Text) }));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(true, "text", new { }),
                             new[] { new SqlNonQueryCommand("text", new DbParameter[0], CommandType.Text) }));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(true, "text", new { Parameter = new SQLiteParameterValueStub() }),
                             new[]
            {
                new SqlNonQueryCommand("text", new[]
                {
                    new SQLiteParameterValueStub().ToDbParameter("@Parameter")
                }, CommandType.Text)
            }));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(true, "text",
                                                     new { Parameter1 = new SQLiteParameterValueStub(), Parameter2 = new SQLiteParameterValueStub() }),
                             new[]
            {
                new SqlNonQueryCommand("text", new[]
                {
                    new SQLiteParameterValueStub().ToDbParameter("@Parameter1"),
                    new SQLiteParameterValueStub().ToDbParameter("@Parameter2")
                }, CommandType.Text)
            }));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(false, "text"),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(false, "text", parameters: null),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(false, "text", new { }),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(false, "text", new { Parameter = new SQLiteParameterValueStub() }),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             Sql.NonQueryStatementIf(false, "text", new { Parameter1 = new SQLiteParameterValueStub(), Parameter2 = new SQLiteParameterValueStub() }),
                             new SqlNonQueryCommand[0]));
        }
 private IEnumerable <SqlNonQueryCommand> GeneralLedgerEntryPostedHandler(GeneralLedgerEntryPosted @event)
 {
     return(Sql.NonQueryStatementIf(false, ""));
 }