예제 #1
0
		public void CreateCommand_CreateCommand_CheckThatCorrectCommandIsCreated() {
			var provider = A.Fake<IProvider>();
			var dataSource = new DataSource(provider);
			var transaction = A.Fake<ITransaction>();
			var parameter = A.Fake<IDataParameter>();

			var command = dataSource.CreateCommand("commandSting", transaction, CommandType.TableDirect, parameter);
			Assert.AreEqual("commandSting", command.DbCommand.CommandText);
			Assert.AreEqual(transaction.Connection, command.DbCommand.Connection);
			Assert.AreEqual(transaction.DbTransaction, command.DbCommand.Transaction);
			Assert.AreEqual(CommandType.TableDirect, command.DbCommand.CommandType);
		}