public void ColumnDataShouldBeCached()
 {
     var table = new Table("Users", null, TableType.Table);
     
     var realConnectionProvider = new MysqlConnectionProvider();
     realConnectionProvider.SetConnectionString(ConnectionString);
     var proxiedConnectionProvider = A.Fake <IConnectionProvider>((o) => o.Wrapping(realConnectionProvider));
     
     var schemaDataProvider = new MysqlSchemaDataProvider40(proxiedConnectionProvider);
     Enumerable.ToList(schemaDataProvider.GetColumnsFor(table));
     Enumerable.ToList(schemaDataProvider.GetColumnsFor(table));
     Enumerable.ToList(schemaDataProvider.GetColumnsFor(table));
     Enumerable.ToList(schemaDataProvider.GetColumnsFor(table));
     A.CallTo(()=>proxiedConnectionProvider.CreateConnection()).MustHaveHappened(Repeated.Exactly.Once);
 }
        public void CanProvideAllColumnsFromTable()
        {
            var table = new Table("users", null, TableType.Table);
            var expectedColumns = new List<Column>
                                      {
                                          new Column("Id", table, true, DbType.Int32, 11),
                                          new Column("Name", table, false, DbType.String, 255),
                                          new Column("Password", table, false, DbType.String, 255),
                                          new Column("Age", table, false, DbType.Int32, 11)

                                      };
            var connectionProvider = new MysqlConnectionProvider();
            connectionProvider.SetConnectionString(ConnectionString);

            var schemaDataProvider = new MysqlSchemaDataProvider40(connectionProvider);
            var columns = schemaDataProvider.GetColumnsFor(table).Select(c => new Column(c.Name, table, c.IsAutoincrement, c.DbType, c.Capacity)); 
            Assert.AreEqual(expectedColumns.Count, columns.Count());
            columns.Should().Contain(expectedColumns);
        }