예제 #1
0
 public void ComposeUnlessCommandArrayReturnsComposer([Values(true, false)] bool condition)
 {
     Assert.IsInstanceOf <SqlNonQueryCommandComposer>(
         TSql.ComposeUnless(
             condition,
             CommandFactory(),
             CommandFactory()));
 }
예제 #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]));
        }
예제 #3
0
 public void ComposeUnlessCommandEnumerationReturnsComposer([Values(true, false)] bool condition)
 {
     Assert.IsInstanceOf <SqlNonQueryCommandComposer>(
         TSql.ComposeUnless(condition, (IEnumerable <SqlNonQueryCommand>) new[]
     {
         CommandFactory(),
         CommandFactory()
     }));
 }
예제 #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
            }));
        }
예제 #5
0
 public void ComposeUnlessCommandEnumerationCanBeNullWhenConditionIsTrue()
 {
     Assert.DoesNotThrow(() => TSql.ComposeUnless(true, (IEnumerable <SqlNonQueryCommand>)null));
 }
예제 #6
0
 public void ComposeUnlessCommandEnumerationCanNotBeNullWhenConditionIsFalse()
 {
     Assert.Throws <ArgumentNullException>(() => TSql.ComposeUnless(false, (IEnumerable <SqlNonQueryCommand>)null));
 }
예제 #7
0
 public void ComposeUnlessCommandArrayCanBeNullWhenConditionIsTrue()
 {
     // ReSharper disable RedundantCast
     Assert.DoesNotThrow(() => TSql.ComposeUnless(true, (SqlNonQueryCommand[])null));
     // ReSharper restore RedundantCast
 }
예제 #8
0
 public void ComposeUnlessCommandArrayCanNotBeNullWhenConditionIsFalse()
 {
     // ReSharper disable RedundantCast
     Assert.Throws <ArgumentNullException>(() => TSql.ComposeUnless(false, (SqlNonQueryCommand[])null));
     // ReSharper restore RedundantCast
 }