Example #1
0
 public void ComposeUnlessCommandArrayReturnsComposer([Values(true, false)] bool condition)
 {
     Assert.IsInstanceOf <SqlNonQueryCommandComposer>(
         TSql.ComposeUnless(
             condition,
             CommandFactory(),
             CommandFactory()));
 }
Example #2
0
        public void ComposedUnlessCommandArrayIsNotPreservedAndReturnedByComposerWhenConditionIsTrue()
        {
            var command1 = CommandFactory();
            var command2 = CommandFactory();

            SqlNonQueryCommand[] result = TSql.ComposeUnless(true, command1, command2);

            Assert.That(result, Is.EquivalentTo(new SqlNonQueryCommand[0]));
        }
Example #3
0
 public void ComposeUnlessCommandEnumerationReturnsComposer([Values(true, false)] bool condition)
 {
     Assert.IsInstanceOf <SqlNonQueryCommandComposer>(
         TSql.ComposeUnless(condition, (IEnumerable <SqlNonQueryCommand>) new[]
     {
         CommandFactory(),
         CommandFactory()
     }));
 }
Example #4
0
        public void ComposedUnlessCommandEnumerationIsPreservedAndReturnedByComposerWhenConditionIsFalse()
        {
            var command1 = CommandFactory();
            var command2 = CommandFactory();

            SqlNonQueryCommand[] result = TSql.ComposeUnless(false, (IEnumerable <SqlNonQueryCommand>) new[]
            {
                command1, command2
            });

            Assert.That(result, Is.EquivalentTo(new[]
            {
                command1, command2
            }));
        }
Example #5
0
 public void ComposeUnlessCommandEnumerationCanBeNullWhenConditionIsTrue()
 {
     Assert.DoesNotThrow(() => TSql.ComposeUnless(true, (IEnumerable <SqlNonQueryCommand>)null));
 }
Example #6
0
 public void ComposeUnlessCommandEnumerationCanNotBeNullWhenConditionIsFalse()
 {
     Assert.Throws <ArgumentNullException>(() => TSql.ComposeUnless(false, (IEnumerable <SqlNonQueryCommand>)null));
 }
Example #7
0
 public void ComposeUnlessCommandArrayCanBeNullWhenConditionIsTrue()
 {
     // ReSharper disable RedundantCast
     Assert.DoesNotThrow(() => TSql.ComposeUnless(true, (SqlNonQueryCommand[])null));
     // ReSharper restore RedundantCast
 }
Example #8
0
 public void ComposeUnlessCommandArrayCanNotBeNullWhenConditionIsFalse()
 {
     // ReSharper disable RedundantCast
     Assert.Throws <ArgumentNullException>(() => TSql.ComposeUnless(false, (SqlNonQueryCommand[])null));
     // ReSharper restore RedundantCast
 }