|
namespace Overboard.Linq {
using System;
using NUnit.Framework;
partial class MappedQueryTests {
// Control case
// Exception thrown by LINQ to SQL
[Test]
[ExpectedException(ExceptionType = typeof(InvalidOperationException))]
public void InstanceFieldUnmapped() {
CountWhere(p => p._MinimumRetirementDateUnmapped > January1st1900);
}
[Test]
[ExpectedException(ExceptionType = typeof(MissingMemberException))]
public void InstanceFieldBadMap() {
CountWhere(p => p._MinimumRetirementDateBadMapName > January1st1900);
}
[Test]
public void InstanceFieldToFieldExpression() {
int count = CountWhere(p => p._MinimumRetirementDateToFieldExpression > January1st1900);
Assert.AreEqual(RetirementAgeResults, count);
}
[Test]
public void InstanceFieldToFieldLambda() {
int count = CountWhere(p => p._MinimumRetirementDateToFieldLambda > January1st1900);
Assert.AreEqual(RetirementAgeResults, count);
}
[Test]
public void InstanceFieldToPropertyExpression() {
int count = CountWhere(p => p._MinimumRetirementDateToPropertyExpression > January1st1900);
Assert.AreEqual(RetirementAgeResults, count);
}
[Test]
public void InstanceFieldToPropertyLambda() {
int count = CountWhere(p => p._MinimumRetirementDateToPropertyLambda > January1st1900);
Assert.AreEqual(RetirementAgeResults, count);
}
[Test]
public void InstanceFieldToMethodExpression() {
int count = CountWhere(p => p._MinimumRetirementDateToMethodExpression > January1st1900);
Assert.AreEqual(RetirementAgeResults, count);
}
[Test]
public void InstanceFieldToMethodLambda() {
int count = CountWhere(p => p._MinimumRetirementDateToMethodLambda > January1st1900);
Assert.AreEqual(RetirementAgeResults, count);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
David Nelson has been programming in various languages for 17 years, and has been programming in .NET (C# and VB.NET) since 2003.
He is a MCTS in .NET 2.0 Web Applications, and is a moderator on the MSDN Forums (http://forums.microsoft.com/msdn).