package roart.iclij.verifyprofit;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.junit.jupiter.api.Test;

import roart.testdata.TestData;

public class VerifyProfitTest {
    @Test
    public void test() {
        TestData testData = new TestData();
        Map<String, List<List<Double>>> categoryValueMap = testData.getAbnormCatValMap();
        List<String> stockDates = testData.getStockDates(LocalDate.now(), 3, false);
        int firstidx = 2; 
        int lastidx = 0; 
        Double margin = 9.0;
        Set<String> excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
        margin = 0.0;
        excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);
        assertEquals(1, excluded.size());
    }
}

@@ -957,10 +957,703 @@
 ;%0A    %7D%0A
+    %0A    @Test%0A    public void testWithHoles() %7B%0A        TestData testData = new TestData();%0A        Map%3CString, List%3CList%3CDouble%3E%3E%3E categoryValueMap = testData.getAbnormWithHolesCatValMap();%0A        List%3CString%3E stockDates = testData.getStockDates(LocalDate.now(), 4, false);%0A        int firstidx = 3; %0A        int lastidx = 0; %0A        Double margin = 9.0;%0A        Set%3CString%3E excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);%0A        assertEquals(1, excluded.size());%0A        margin = 0.0;%0A        excluded = new VerifyProfit().getTrend(categoryValueMap, stockDates, firstidx, lastidx, margin);%0A        assertEquals(1, excluded.size());%0A    %7D%0A
 %7D%0A

Change for remove stocks with abnormal change due to splits etc (I288).