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()
|
||||
|
||||
Reference in New Issue
Block a user