Rename test sample table to sample_users and retarget tests to net10.0
This commit is contained in:
@@ -58,14 +58,14 @@ namespace DynamORM.Tests.Select
|
||||
/// <returns>Dynamic table.</returns>
|
||||
public virtual dynamic GetTestTable()
|
||||
{
|
||||
return Database.Table("users");
|
||||
return Database.Table("sample_users");
|
||||
}
|
||||
|
||||
/// <summary>Create table using specified method.</summary>
|
||||
/// <returns>Dynamic table.</returns>
|
||||
public virtual IDynamicSelectQueryBuilder GetTestBuilder()
|
||||
{
|
||||
return Database.Table("users").Query() as IDynamicSelectQueryBuilder;
|
||||
return Database.Table("sample_users").Query() as IDynamicSelectQueryBuilder;
|
||||
}
|
||||
|
||||
#region Select
|
||||
@@ -277,7 +277,7 @@ namespace DynamORM.Tests.Select
|
||||
public void TestScalarGroupConcat()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat("first") AS first from "users" where "id" < 20;
|
||||
// select group_concat("first") AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestTable().Scalar(columns: "first:first:group_concat", id: new DynamicColumn { Operator = DynamicColumn.CompareOperator.Lt, Value = 20 }));
|
||||
}
|
||||
@@ -287,7 +287,7 @@ namespace DynamORM.Tests.Select
|
||||
public void TestScalarGroupConcat2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat("first") AS first from "users" where "id" < 20;
|
||||
// select group_concat("first") AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestBuilder()
|
||||
.Where(x => x.id < 20)
|
||||
@@ -300,7 +300,7 @@ namespace DynamORM.Tests.Select
|
||||
public void TestScalarGroupConcatNoAggregateField()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat(first) AS first from "users" where "id" < 20;
|
||||
// select group_concat(first) AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestTable().Scalar(columns: "group_concat(first):first", id: new DynamicColumn { Operator = DynamicColumn.CompareOperator.Lt, Value = 20 }));
|
||||
}
|
||||
@@ -310,7 +310,7 @@ namespace DynamORM.Tests.Select
|
||||
public void TestScalarGroupConcatNoAggregateField2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat(first) AS first from "users" where "id" < 20;
|
||||
// select group_concat(first) AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestBuilder()
|
||||
.Where(x => x.id < 20)
|
||||
@@ -318,7 +318,7 @@ namespace DynamORM.Tests.Select
|
||||
.Scalar());
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") occurs from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") occurs from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public void TestFancyAggregateQuery()
|
||||
{
|
||||
@@ -333,7 +333,7 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(1, v.Last().occurs);
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") occurs from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") occurs from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public void TestFancyAggregateQuery2()
|
||||
{
|
||||
@@ -353,14 +353,14 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(1, v.Last().occurs);
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public void TestAggregateInAggregate()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestTable().Scalar(columns: @"length(""login""):len:avg"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public void TestAggregateInAggregate2()
|
||||
{
|
||||
@@ -369,14 +369,14 @@ namespace DynamORM.Tests.Select
|
||||
.Scalar());
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public void TestAggregateInAggregateMark2()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestTable().Avg(columns: @"length(""email""):len"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public void TestAggregateInAggregateMark3()
|
||||
{
|
||||
@@ -385,7 +385,7 @@ namespace DynamORM.Tests.Select
|
||||
.Scalar());
|
||||
}
|
||||
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "users" where length("email") > 27;</code>.</summary>
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "sample_users" where length("email") > 27;</code>.</summary>
|
||||
public void TestFunctionInWhere()
|
||||
{
|
||||
Assert.AreEqual(97,
|
||||
@@ -399,7 +399,7 @@ namespace DynamORM.Tests.Select
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "users" where length("email") > 27;</code>.</summary>
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "sample_users" where length("email") > 27;</code>.</summary>
|
||||
public void TestFunctionInWhere2()
|
||||
{
|
||||
Assert.AreEqual(97, GetTestBuilder()
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <returns>Dynamic table.</returns>
|
||||
public override dynamic GetTestTable()
|
||||
{
|
||||
return Database.Table("users", new string[] { "id" });
|
||||
return Database.Table("sample_users", new string[] { "id" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ namespace DynamORM.Tests.Select
|
||||
/// <returns>Dynamic table.</returns>
|
||||
public override dynamic GetTestTable()
|
||||
{
|
||||
return Database.Table<users>();
|
||||
return Database.Table<sample_users>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ namespace DynamORM.Tests.Select
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = Database.From<Users>();
|
||||
|
||||
Assert.AreEqual("SELECT * FROM \"users\"", cmd.CommandText());
|
||||
Assert.AreEqual("SELECT * FROM \"sample_users\"", cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -95,7 +95,7 @@ namespace DynamORM.Tests.Select
|
||||
{
|
||||
IDynamicSelectQueryBuilder cmd = Database.From<Users>("u");
|
||||
|
||||
Assert.AreEqual("SELECT * FROM \"users\" AS u", cmd.CommandText());
|
||||
Assert.AreEqual("SELECT * FROM \"sample_users\" AS u", cmd.CommandText());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace DynamORM.Tests.Select
|
||||
[TestFixture]
|
||||
public class RenamedTypedAccessTests : TypedAccessTests<Users>
|
||||
{
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public override void TestTypedFancyAggregateQuery()
|
||||
{
|
||||
@@ -52,7 +52,7 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(1, v.Last().AggregateField);
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public override void TestGenericFancyAggregateQuery()
|
||||
{
|
||||
|
||||
@@ -315,7 +315,7 @@ namespace DynamORM.Tests.Select
|
||||
public virtual void TestTypedScalarGroupConcat()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat("first") AS first from "users" where "id" < 20;
|
||||
// select group_concat("first") AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestTable().Scalar(type: typeof(T), columns: "first:first:group_concat", id: new DynamicColumn { Operator = DynamicColumn.CompareOperator.Lt, Value = 20 }));
|
||||
}
|
||||
@@ -325,7 +325,7 @@ namespace DynamORM.Tests.Select
|
||||
public virtual void TestTypedScalarGroupConcat2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat("first") AS first from "users" where "id" < 20;
|
||||
// select group_concat("first") AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestBuilder()
|
||||
.From(x => x(typeof(T)).As(x.t))
|
||||
@@ -339,7 +339,7 @@ namespace DynamORM.Tests.Select
|
||||
public virtual void TestTypedScalarGroupConcatNoAggregateField()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat(first) AS first from "users" where "id" < 20;
|
||||
// select group_concat(first) AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestTable().Scalar(type: typeof(T), columns: "group_concat(first):first", id: new DynamicColumn { Operator = DynamicColumn.CompareOperator.Lt, Value = 20 }));
|
||||
}
|
||||
@@ -349,7 +349,7 @@ namespace DynamORM.Tests.Select
|
||||
public virtual void TestTypedScalarGroupConcatNoAggregateField2()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat("first") AS first from "users" where "id" < 20;
|
||||
// select group_concat("first") AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestBuilder()
|
||||
.From(x => x(typeof(T)).As(x.t))
|
||||
@@ -358,7 +358,7 @@ namespace DynamORM.Tests.Select
|
||||
.Scalar());
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestTypedFancyAggregateQuery()
|
||||
{
|
||||
@@ -373,7 +373,7 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(1, v.Last().aggregatefield);
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestTypedFancyAggregateQuery2()
|
||||
{
|
||||
@@ -394,14 +394,14 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(1, v.Last().aggregatefield);
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregate()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestTable().Scalar(type: typeof(T), columns: @"length(""login""):len:avg"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregate2()
|
||||
{
|
||||
@@ -411,14 +411,14 @@ namespace DynamORM.Tests.Select
|
||||
.Scalar());
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregateMark2()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestTable().Avg(type: typeof(T), columns: @"length(""email""):len"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestTypedAggregateInAggregateMark3()
|
||||
{
|
||||
@@ -428,7 +428,7 @@ namespace DynamORM.Tests.Select
|
||||
.Scalar());
|
||||
}
|
||||
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "users" where length("email") > 27;</code>.</summary>
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "sample_users" where length("email") > 27;</code>.</summary>
|
||||
public virtual void TestTypedFunctionInWhere()
|
||||
{
|
||||
Assert.AreEqual(97,
|
||||
@@ -442,7 +442,7 @@ namespace DynamORM.Tests.Select
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "users" where length("email") > 27;</code>.</summary>
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "sample_users" where length("email") > 27;</code>.</summary>
|
||||
public virtual void TestTypedFunctionInWhere2()
|
||||
{
|
||||
Assert.AreEqual(97, GetTestBuilder()
|
||||
@@ -807,7 +807,7 @@ namespace DynamORM.Tests.Select
|
||||
public virtual void TestGenericScalarGroupConcat()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat("first") AS first from "users" where "id" < 20;
|
||||
// select group_concat("first") AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestTable().Scalar<T>(columns: "first:first:group_concat", id: new DynamicColumn { Operator = DynamicColumn.CompareOperator.Lt, Value = 20 }));
|
||||
}
|
||||
@@ -817,12 +817,12 @@ namespace DynamORM.Tests.Select
|
||||
public virtual void TestGenericScalarGroupConcatNoAggregateField()
|
||||
{
|
||||
// This test should produce something like this:
|
||||
// select group_concat(first) AS first from "users" where "id" < 20;
|
||||
// select group_concat(first) AS first from "sample_users" where "id" < 20;
|
||||
Assert.AreEqual("Clarke,Marny,Dai,Forrest,Blossom,George,Ivory,Inez,Sigourney,Fulton,Logan,Anne,Alexandra,Adena,Lionel,Aimee,Selma,Lara,Ori",
|
||||
GetTestTable().Scalar<T>(columns: "group_concat(first):first", id: new DynamicColumn { Operator = DynamicColumn.CompareOperator.Lt, Value = 20 }));
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "sample_users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestGenericFancyAggregateQuery()
|
||||
{
|
||||
@@ -837,21 +837,21 @@ namespace DynamORM.Tests.Select
|
||||
Assert.AreEqual(1, v.Last().aggregatefield);
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("login")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestGenericAggregateInAggregate()
|
||||
{
|
||||
Assert.AreEqual(12.77, GetTestTable().Scalar<T>(columns: @"length(""login""):len:avg"));
|
||||
}
|
||||
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "users";</code>.</summary>
|
||||
/// <summary>This time also something fancy... aggregate in aggregate <code>select AVG(LENGTH("email")) len from "sample_users";</code>.</summary>
|
||||
[Test]
|
||||
public virtual void TestGenericAggregateInAggregateMark2()
|
||||
{
|
||||
Assert.AreEqual(27.7, GetTestTable().Avg<T>(columns: @"length(""email""):len"));
|
||||
}
|
||||
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "users" where length("email") > 27;</code>.</summary>
|
||||
/// <summary>Test emails longer than 27 chars. <code>select count(*) from "sample_users" where length("email") > 27;</code>.</summary>
|
||||
public virtual void TestGenericFunctionInWhere()
|
||||
{
|
||||
Assert.AreEqual(97,
|
||||
|
||||
Reference in New Issue
Block a user