public void Setup() { _mockIBaseDatabaseConnection = new Mock <IBaseDatabaseConnection>(); _mockIDbConnection = new Mock <IDbConnection>(); _mockIDbCommand = new Mock <IDbCommand>(); _mockIDataReader = new Mock <IDataReader>(); _mockIBaseDatabaseConnection .Setup(s => s.GetDatabaseConnection()) .Returns(_mockIDbConnection.Object); _mockIDbConnection .Setup(s => s.CreateCommand()) .Returns(_mockIDbCommand.Object); _mockIDbCommand .Setup(s => s.ExecuteReader()) .Returns(_mockIDataReader.Object); _biz = new GetDbTableColumnInfoService(_mockIBaseDatabaseConnection.Object); _tableName = "TableName"; _tableDescription = "Table description"; _columnName = "ColumnName"; _columnDescription = "Column description"; _columnType = "varchar"; _columnLength = 255; _defaultValue = "Default"; _allowsNull = false; _keySequence = 1; _lastModified = new DateTime(2000, 1, 1); }
public void GetDbTableColumnInfoService_ctor_ArgumentNullExceptionThrownWhenIBaseDatabaseConnectionNotProvided() { // Arrange / Act / Assert _biz = new GetDbTableColumnInfoService(null); }