コード例 #1
0
        public void ValidateSqlAdapter()
        {
            ExpressionConfigurations.SetSqlAdapter(new SqlServerAdapter());
            Expression <Func <User, bool> > expression = u => u.Name == "Foo";

            (string whereClause, Dictionary <string, object> parameters) = expression.ToWhereClause();
            Dictionary <string, object> expectedParameters = new Dictionary <string, object>();

            expectedParameters.Add("@Name", "Foo");
            Assert.AreEqual("[Username] = @Name", whereClause);
            AssertParameters(expectedParameters, parameters);
        }
コード例 #2
0
 public void TestCleanup()
 {
     ExpressionConfigurations.SetSqlAdapter(new DefaultSqlAdapter());
 }