public void Update_CaseWhenPair_NoChanges() { var caseWhenPair = new SqlCaseExpression.CaseWhenPair(_predicate1, _value1); var result = caseWhenPair.Update(_predicate1, _value1); Assert.That(result, Is.SameAs(caseWhenPair)); }
public void VisitSqlCaseExpression_NoElse() { var case1 = new SqlCaseExpression.CaseWhenPair(new SqlCustomTextExpression("test1", typeof(bool)), new SqlCustomTextExpression("value1", typeof(int))); var case2 = new SqlCaseExpression.CaseWhenPair(new SqlCustomTextExpression("test2", typeof(bool)), new SqlCustomTextExpression("value2", typeof(int))); var expression = new SqlCaseExpression(typeof(int?), new[] { case1, case2 }, null); SqlGeneratingExpressionVisitor.GenerateSql(expression, _commandBuilder, _stageMock); Assert.That(_commandBuilder.GetCommandText(), Is.EqualTo("CASE WHEN test1 THEN value1 WHEN test2 THEN value2 END")); }