Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (31 sloc) 1.293 kb
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Simple.Data.UnitTest
using NUnit.Framework;
public class ExpressionHelperTest
public void DictionaryToExpressionTest()
var dict = new Dictionary<string, object>
{ "foo", 1 },
{ "bar", 2 }
var actual = ExpressionHelper.CriteriaDictionaryToExpression("quux", dict);
Assert.AreEqual(SimpleExpressionType.And, actual.Type);
var actualFirst = (SimpleExpression)actual.LeftOperand;
var actualSecond = (SimpleExpression)actual.RightOperand;
Assert.AreEqual("foo", ((ObjectReference)actualFirst.LeftOperand).GetName());
Assert.AreEqual(SimpleExpressionType.Equal, actualFirst.Type);
Assert.AreEqual(1, actualFirst.RightOperand);
Assert.AreEqual("bar", ((ObjectReference)actualSecond.LeftOperand).GetName());
Assert.AreEqual(SimpleExpressionType.Equal, actualSecond.Type);
Assert.AreEqual(2, actualSecond.RightOperand);
Jump to Line
Something went wrong with that request. Please try again.