public void ComposeUnlessCommandArrayReturnsComposer([Values(true, false)] bool condition) { Assert.IsInstanceOf <SqlNonQueryCommandComposer>( TSql.ComposeUnless( condition, CommandFactory(), CommandFactory())); }
public void ComposedUnlessCommandArrayIsNotPreservedAndReturnedByComposerWhenConditionIsTrue() { var command1 = CommandFactory(); var command2 = CommandFactory(); SqlNonQueryCommand[] result = TSql.ComposeUnless(true, command1, command2); Assert.That(result, Is.EquivalentTo(new SqlNonQueryCommand[0])); }
public void ComposeUnlessCommandEnumerationReturnsComposer([Values(true, false)] bool condition) { Assert.IsInstanceOf <SqlNonQueryCommandComposer>( TSql.ComposeUnless(condition, (IEnumerable <SqlNonQueryCommand>) new[] { CommandFactory(), CommandFactory() })); }
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 })); }
public void ComposeUnlessCommandEnumerationCanBeNullWhenConditionIsTrue() { Assert.DoesNotThrow(() => TSql.ComposeUnless(true, (IEnumerable <SqlNonQueryCommand>)null)); }
public void ComposeUnlessCommandEnumerationCanNotBeNullWhenConditionIsFalse() { Assert.Throws <ArgumentNullException>(() => TSql.ComposeUnless(false, (IEnumerable <SqlNonQueryCommand>)null)); }
public void ComposeUnlessCommandArrayCanBeNullWhenConditionIsTrue() { // ReSharper disable RedundantCast Assert.DoesNotThrow(() => TSql.ComposeUnless(true, (SqlNonQueryCommand[])null)); // ReSharper restore RedundantCast }
public void ComposeUnlessCommandArrayCanNotBeNullWhenConditionIsFalse() { // ReSharper disable RedundantCast Assert.Throws <ArgumentNullException>(() => TSql.ComposeUnless(false, (SqlNonQueryCommand[])null)); // ReSharper restore RedundantCast }