public void HandleResultOperator_WithOrderings_OrderingsAreRemoved ()
    {
      var resultOperator = new DistinctResultOperator();
      _sqlStatementBuilder.Orderings.Add (new Ordering (Expression.Constant ("order1"), OrderingDirection.Asc));

      _handler.HandleResultOperator (resultOperator, _sqlStatementBuilder, _generator, _stage, _context);

      Assert.That (_sqlStatementBuilder.Orderings.Count, Is.EqualTo (0));
    }
    public void HandleResultOperator ()
    {
      var resultOperator = new DistinctResultOperator ();

      _handler.HandleResultOperator (resultOperator, _sqlStatementBuilder, _generator, _stage, _context);

      Assert.That (_sqlStatementBuilder.IsDistinctQuery, Is.True);
      Assert.That (_sqlStatementBuilder.DataInfo, Is.TypeOf (typeof (StreamedSequenceInfo)));
      Assert.That (((StreamedSequenceInfo) _sqlStatementBuilder.DataInfo).DataType, Is.EqualTo (typeof(IQueryable<>).MakeGenericType(typeof(Cook))));
    }
    public void HandleResultOperator_DistinctAfterTopExpression ()
    {
      _sqlStatementBuilder.TopExpression = Expression.Constant ("top");

      var resultOperator = new DistinctResultOperator ();

      _handler.HandleResultOperator (resultOperator, _sqlStatementBuilder, _generator, _stage, _context);

      Assert.That (_sqlStatementBuilder.SqlTables.Count, Is.EqualTo (1));
      Assert.That (((SqlTable) _sqlStatementBuilder.SqlTables[0]).TableInfo, Is.TypeOf(typeof(ResolvedSubStatementTableInfo)));
    }
Ejemplo n.º 4
0
 public void SetResultOperator_Null_ThrowsArgumentNullException ()
 {
   var resultOperator = new DistinctResultOperator ();
   _queryModel.ResultOperators.Add (resultOperator);
   _queryModel.ResultOperators[0] = null;
 }
 public void SetUp ()
 {
   _resultOperator = new DistinctResultOperator ();
 }