private static IEnumerable <TestCaseData> NonQueryStatementUnlessCases()
        {
            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(false, "text"),
                             new[] { new SqlNonQueryCommand("text", new DbParameter[0], CommandType.Text) }));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(false, "text", parameters: null),
                             new[] { new SqlNonQueryCommand("text", new DbParameter[0], CommandType.Text) }));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(false, "text", new { }),
                             new[] { new SqlNonQueryCommand("text", new DbParameter[0], CommandType.Text) }));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(false, "text", new { Parameter = new TestDbParameter() }),
                             new[]
            {
                new SqlNonQueryCommand("text", new[]
                {
                    new TestDbParameter().ToDbParameter("@Parameter")
                }, CommandType.Text)
            }));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(false, "text",
                                                          new { Parameter1 = new TestDbParameter(), Parameter2 = new TestDbParameter() }),
                             new[]
            {
                new SqlNonQueryCommand("text", new[]
                {
                    new TestDbParameter().ToDbParameter("@Parameter1"),
                    new TestDbParameter().ToDbParameter("@Parameter2")
                }, CommandType.Text)
            }));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(true, "text"),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(true, "text", parameters: null),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(true, "text", new { }),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(true, "text", new { Parameter = new TestDbParameter() }),
                             new SqlNonQueryCommand[0]));

            yield return(new TestCaseData(
                             TSql.NonQueryStatementUnless(true, "text", new { Parameter1 = new TestDbParameter(), Parameter2 = new TestDbParameter() }),
                             new SqlNonQueryCommand[0]));
        }
 public void NonQueryStatementUnlessParameterCountNotLimitedTo2098WhenConditionIsMet()
 {
     Assert.Throws <ArgumentException>(() => TSql.NonQueryStatementUnless(false, "", ParameterCountLimitedExceeded.Instance).ToArray());
 }
 public void NonQueryStatementUnlessParameterCountLimitedTo2098WhenConditionIsMet()
 {
     Assert.DoesNotThrow(() => TSql.NonQueryStatementUnless(true, "", ParameterCountLimitedExceeded.Instance).ToArray());
 }