public void Should_be_able_to_get_a_list_of_view_names() { var schemaReader = MockRepository.GenerateStub<ISchemaReader>(); schemaReader.Expect(sr => sr.GetViewsName(_connectionstring)).Return(new List<string>()); var databaseSchemaExplorer = MockRepository.GenerateMock<IDatabaseSchemaExplorer>(); databaseSchemaExplorer.Expect(de => de.GetViewsName(Arg<IConnectionstringArguments>.Is.Anything)).Return(new List<string>().AsQueryable()); _databaseSchemaExplorerController = new DatabaseSchemaExplorerController(_connectionstringArgumentsMapper, databaseSchemaExplorer); var viewNames = _databaseSchemaExplorerController.ViewsName("SqlServer", "Provider", "DataSource", "DatabaseName", "Username", "Password"); Assert.IsNotNull(viewNames); }
public void Should_be_able_to_get_a_table_info() { var schemaReader = MockRepository.GenerateStub<ISchemaReader>(); const string tableName = "tableName"; schemaReader.Expect(sr => sr.GetTable(_connectionstring, tableName)).Return(new Table(tableName)); var databaseSchemaExplorer = MockRepository.GenerateMock<IDatabaseSchemaExplorer>(); databaseSchemaExplorer.Expect(de => de.GetTable(Arg<IConnectionstringArguments>.Is.Anything, Arg<string>.Is.Anything)).Return(new Table("TableName")); _databaseSchemaExplorerController = new DatabaseSchemaExplorerController(_connectionstringArgumentsMapper, databaseSchemaExplorer); var table = _databaseSchemaExplorerController.Tables("SqlServer", "Provider", "DataSource", "DatabaseName", tableName, "Username", "Password"); Assert.IsNotNull(table); }