/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */

package io.shardingsphere.core.executor.sql.execute.result;

import io.shardingsphere.core.merger.QueryResult;
import lombok.SneakyThrows;
import org.junit.Before;
import org.junit.Test;

import java.util.Collection;
import java.util.LinkedList;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class DistinctQueryResultTest {
    
    private DistinctQueryResult distinctQueryResult;
    
    @Before
    @SneakyThrows
    public void setUp() {
        Collection<QueryResult> queryResults = new LinkedList<>();
        QueryResult queryResult1 = mock(QueryResult.class);
        when(queryResult1.getColumnCount()).thenReturn(1);
        when(queryResult1.getColumnLabel(1)).thenReturn("order_id");
        when(queryResult1.getValue(1, Object.class)).thenReturn(10);
    }
    
    @Test
    public void assertDivide() {
    }
    
    @Test
    public void assertNext() {
    }
    
    @Test
    public void assertGetValue() {
    }
    
    @Test
    public void assertGetValue1() {
    }
    
    @Test
    public void assertGetCalendarValue() {
    }
    
    @Test
    public void assertGetCalendarValue1() {
    }
    
    @Test
    public void assertGetInputStream() {
    }
    
    @Test
    public void assertGetInputStream1() {
    }
    
    @Test
    public void assertWasNull() {
    }
    
    @Test
    public void assertGetColumnCount() {
    }
    
    @Test
    public void assertGetColumnLabel() {
    }
    
    @Test
    public void assertGetColumnIndex() {
    }
    
    @Test
    public void assertGetColumnLabelAndIndexMap() {
    }
    
    @Test
    public void assertGetResultData() {
    }
    
    @Test
    public void assertGetCurrentRow() {
    }
}

@@ -1063,43 +1063,176 @@
     
-@SneakyThrows%0A    public void setUp
+public void setUp() %7B%0A        Collection%3CQueryResult%3E queryResults = getQueryResults();%0A    %7D%0A    %0A    @SneakyThrows%0A    private Collection%3CQueryResult%3E getQueryResults
 () %7B
@@ -1264,28 +1264,22 @@
 Result%3E 
-queryR
+r
 esult
-s
  = new L
@@ -1289,24 +1289,67 @@
 edList%3C%3E();%0A
+        for (int i = 1; i %3C= 3; i++) %7B%0A    
         Quer
@@ -1367,17 +1367,16 @@
 ryResult
-1
  = mock(
@@ -1395,32 +1395,36 @@
 class);%0A        
+  
+  
 when(queryResult
@@ -1415,33 +1415,32 @@
 when(queryResult
-1
 .getColumnCount(
@@ -1457,32 +1457,36 @@
 urn(1);%0A        
+  
+  
 when(queryResult
@@ -1481,25 +1481,24 @@
 (queryResult
-1
 .getColumnLa
@@ -1501,17 +1501,17 @@
 mnLabel(
-1
+i
 )).thenR
@@ -1529,16 +1529,20 @@
 r_id%22);%0A
+    
         
@@ -1557,17 +1557,16 @@
 ryResult
-1
 .getValu
@@ -1567,17 +1567,17 @@
 etValue(
-1
+i
 , Object
@@ -1598,17 +1598,91 @@
 eturn(10
-)
+ * i);%0A            result.add(queryResult);%0A        %7D%0A        return result
 ;%0A    %7D%0A

add getQueryResults()