linq - how to test expression reducers
"Tuna Toksöz" <[email protected]> Fri, 15 Aug 2008 16:54:39 +0300
| Newsgroups | gmane.comp.windows.dotnet.nhibernate.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello team,
I am working on Expression reducers to simplify complex expressions.
I made LogicalExpressionReducer which simply converts not(not(not(true))) to
ConstantExpression(false) and (true & x.Name=="johndoe") to (x.Name=="john
doe"), meaning that it just uses the truth table to reduce expressions.
The problem with expressions is that they are trees! For simple ones, it is
easy to check if I get the same result but complex ones are hard to deal
with.
I first thought that I can use .ToString() of expression which produces
string representation of an expression, that is some thing like
Assert.AreEqual("false",reducedExpression.ToString())
But this simply sounds incorrect to me. I then thought about using visitors
to check for equality, but not sure about that.
2nd one sounds the way to go, but are there any simpler way to test it?
Producing
--
Tuna Toksöz
Typos included to enhance the readers attention!
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Nhibernate-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nhibernate-development