ContainsFulltextMethodCallTransformer implements IMethodCallTransformer for the StringExtensions.SqlContainsFulltext(string, string) extension methods.
Inheritance: IMethodCallTransformer
    public void Transform_TwoArguments ()
    {
      var method = typeof (StringExtensions).GetMethod (
          "SqlContainsFulltext",
          BindingFlags.Public | BindingFlags.Static,
          null,
          CallingConventions.Any,
          new[] { typeof (string), typeof (string), typeof (string) },
          null);
      var objectExpression = Expression.Constant ("Test");
      var argument1 = Expression.Constant ("es");
      var language = Expression.Constant ("language");
      var expression = Expression.Call (method, objectExpression, argument1, language);
      var transformer = new ContainsFulltextMethodCallTransformer();

      var result = transformer.Transform (expression);

      var argumentExpression = Expression.Constant (string.Format ("{0}", argument1.Value));

      var compositeExpression = new SqlCompositeCustomTextGeneratorExpression (
          typeof (string), new SqlCustomTextExpression ("LANGUAGE ", typeof (string)), language);

      var expectedResult =
          new SqlFunctionExpression (typeof (bool), "CONTAINS", objectExpression, argumentExpression, compositeExpression);

      SqlExpressionTreeComparer.CheckAreEqualTrees (expectedResult, result);
    }
    public void GetTransformer ()
    {
      var registryMock = MockRepository.GenerateStrictMock<IMethodCallTransformerProvider>();
      var methodCallTransformerRegistry = new CompoundMethodCallTransformerProvider (registryMock);
      var methodCallExpression = ExpressionHelper.CreateMethodCallExpression<Cook>();
      var fakeTransformer = new ContainsFulltextMethodCallTransformer();

      registryMock
          .Expect (mock => mock.GetTransformer (methodCallExpression))
          .Return (fakeTransformer);
      registryMock.Replay();

      var result = methodCallTransformerRegistry.GetTransformer (methodCallExpression);

      registryMock.VerifyAllExpectations();
      Assert.That (result, Is.SameAs (fakeTransformer));
    }
    public void Transform_OneArgument ()
    {
      var method = typeof (StringExtensions).GetMethod (
          "SqlContainsFulltext",
          BindingFlags.Public | BindingFlags.Static,
          null,
          CallingConventions.Any,
          new[] { typeof (string), typeof (string) },
          null);
      var objectExpression = Expression.Constant ("Test");
      var argument1 = Expression.Constant ("es");
      var expression = Expression.Call (method, objectExpression, argument1);
      var transformer = new ContainsFulltextMethodCallTransformer();

      var result = transformer.Transform (expression);

      var rightExpression = Expression.Constant (string.Format ("{0}", argument1.Value));
      var expectedResult = new SqlFunctionExpression (typeof (bool), "CONTAINS", objectExpression, rightExpression);

      SqlExpressionTreeComparer.CheckAreEqualTrees (expectedResult, result);
    }