Esempio n. 1
0
    public static SqlTableReference ToSqlTableReference(this SISTable sisTable,
                                                        ISqlConnectionProvider sqlConnectionProvider)
    {
        var sqlTableReference = new SqlTableReference(sqlConnectionProvider,
                                                      sisTable.TABLE_SCHEMA,
                                                      sisTable.TABLE_NAME);

        return(sqlTableReference);
    }
Esempio n. 2
0
    public void CreateSqlTableReferenceFromInformationSchemaTable_ShouldWork()
    {
        SISTable sisTable = null;
        var      sqlConnectionProvider = new StaticSqlConnectionProvider("", "");

        "Given a InformationSchemaTable"
        ._(() =>
        {
            sisTable = InformationSchemaTableDefinitionFromJson.SampleTable().InformationSchemaTable;
        });

        "Then we should be able to create a SqlTableReference from it"
        ._(() =>
        {
            var sqlTableReference = sisTable.ToSqlTableReference(sqlConnectionProvider);
            sqlTableReference.SchemaName.Should().Be("HumanResources");
            sqlTableReference.TableName.Should().Be("Employee");
            sqlTableReference.SqlConnectionProvider.GetSqlConnectionString()
            .Should()
            .Be(sqlConnectionProvider.GetSqlConnectionString());
        });
    }