Exemplo n.º 1
0
    public void Returns_Extracted_Columns()
    {
        // Arrange
        var table = new FooTable();

        // Act
        var result = QueryF.GetColumnsFromTable <Foo>(table);

        // Assert
        Assert.Collection(result,
                          x => Assert.Equal((table.GetName(), table.FooId), (x.TblName, x.ColName)),
                          x => Assert.Equal(table.Bar0, x.ColName),
                          x => Assert.Equal(table.Bar1, x.ColName)
                          );
    }
Exemplo n.º 2
0
    public void Returns_Extracted_Columns_Without_Duplicates()
    {
        // Arrange
        var t0 = new FooTable();
        var t1 = new FooUnwriteableTable();
        var t2 = new FooDuplicateTable();

        // Act
        var result = Extract <FooCombined> .From(t0, t1, t2);

        // Assert
        var some = result.AssertSome();

        Assert.Collection(some,
                          x => Assert.Equal((t0.GetName(), t0.FooId), (x.TblName, x.ColName)),
                          x => Assert.Equal(t0.Bar0, x.ColName),
                          x => Assert.Equal(t1.Bar2, x.ColName)
                          );
    }