/Rhino.Etl.Tests/Dsl/DatabaseToDatabaseWithTransformFixture.cs
http://github.com/ayende/rhino-etl · C# · 42 lines · 37 code · 5 blank · 0 comment · 1 complexity · 503f557f377fec61d8f160f79f843052 MD5 · raw file
- using Rhino.Etl.Core.Infrastructure;
- namespace Rhino.Etl.Tests.Dsl
- {
- using System.Collections.Generic;
- using System.Data;
- using Core;
- using Xunit;
-
- public class DatabaseToDatabaseWithTransformFixture : BaseUserToPeopleTest
- {
- [Fact]
- public void CanCompile()
- {
- using(EtlProcess process = CreateDslInstance("Dsl/UsersToPeople.boo"))
- Assert.NotNull(process);
- }
- [Fact]
- public void CanCopyTableWithTransform()
- {
- using(EtlProcess process = CreateDslInstance("Dsl/UsersToPeople.boo"))
- process.Execute();
- List<string[]> names = Use.Transaction<List<string[]>>("test", delegate(IDbCommand cmd)
- {
- List<string[]> tuples = new List<string[]>();
- cmd.CommandText = "SELECT firstname, lastname from people order by userid";
- using (IDataReader reader = cmd.ExecuteReader())
- {
- while (reader.Read())
- {
- tuples.Add(new string[] { reader.GetString(0), reader.GetString(1) });
- }
- }
- return tuples;
- });
- AssertNames(names);
- }
- }
- }