Select improvements and alias parsing.

Insert and updates evolved.
Written more tests that intended to break parser.
Added basic exception handling, telling user what went wrong.

TODO:
 * INSERT INTO ... SELECT ...
 * Extend and normalize documentation.
This commit is contained in:
grzegorz.russek
2013-06-05 11:53:49 +00:00
parent de58df8c60
commit 3aa20eb50b
13 changed files with 423 additions and 44 deletions

View File

@@ -436,29 +436,23 @@ namespace DynamORM.Tests.Select
Assert.AreEqual(exp.last, o.last);
}
/// <summary>Test dynamic duplicate column name ocurrance.</summary>
/// <summary>Test dynamic duplicate column name occurrence.</summary>
[Test]
public void TestDuplicateColumnNameException()
{
Assert.Throws<ArgumentException>(() => GetTestBuilder()
.Where(x => x.id == 19)
.Select(x => new { id = x.id, first = x.first, last = x.last })
.Select(x => new
{
id = x.id,
first = x.first,
last = x.last,
})
.Select(x => x.last.As(x.first)) // Make last be first
.Execute()
.First());
}
[Test]
public void TestEmptyColumnName()
{
var v = GetTestBuilder()
.Select(x => x.first, x => x.Count(x.first))
.GroupBy(x => x.first)
.OrderBy(x => x.Desc(2))
.Execute()
.ToList();
}
#endregion Select
#region Where