Updated test project.
This commit is contained in:
@@ -29,16 +29,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DynamORM.Tests.Helpers;
|
||||
using NUnit.Framework;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace DynamORM.Tests.Select
|
||||
{
|
||||
/// <summary>Test typed ORM.</summary>
|
||||
[TestFixture]
|
||||
[TestClass]
|
||||
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>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestTypedFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query(type: typeof(Users), columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -53,7 +53,7 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test something fancy... like: <code>select "first", count("first") aggregatefield from "users" group by "first" order by 2 desc;</code>.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestGenericFancyAggregateQuery()
|
||||
{
|
||||
var v = (GetTestTable().Query<Users>(columns: "first,first:AggregateField:count", group: "first", order: ":desc:2") as IEnumerable<dynamic>).ToList();
|
||||
@@ -68,21 +68,21 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>First</c> method.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestTypedFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First(type: typeof(Users), columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Last</c> method.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestTypedLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last(type: typeof(Users), columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test typed <c>Single</c> multi.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestTypedSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -94,35 +94,35 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression equal.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestTypedWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("id").Eq(100)).Login);
|
||||
}
|
||||
|
||||
/// <summary>Test typed where expression like.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestTypedWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single(type: typeof(Users), where: new DynamicColumn("login").Like("Hoyt.%")).Id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>First</c> method.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestGenericFirst()
|
||||
{
|
||||
Assert.AreEqual(1, GetTestTable().First<Users>(columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Last</c> method.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestGenericLast()
|
||||
{
|
||||
Assert.AreEqual(200, GetTestTable().Last<Users>(columns: "id").Id);
|
||||
}
|
||||
|
||||
/// <summary>Test generic <c>Single</c> multi.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestGenericSingleObject()
|
||||
{
|
||||
var exp = new { id = 19, first = "Ori", last = "Ellis" };
|
||||
@@ -134,14 +134,14 @@ namespace DynamORM.Tests.Select
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression equal.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestGenericWhereEq()
|
||||
{
|
||||
Assert.AreEqual("hoyt.tran", GetTestTable().Single<Users>(where: new DynamicColumn("id").Eq(100)).Login);
|
||||
}
|
||||
|
||||
/// <summary>Test generic where expression like.</summary>
|
||||
[Test]
|
||||
[TestMethod]
|
||||
public override void TestGenericWhereLike()
|
||||
{
|
||||
Assert.AreEqual(100, GetTestTable().Single<Users>(where: new DynamicColumn("login").Like("Hoyt.%")).Id);
|
||||
|
||||
Reference in New Issue
Block a user