Search in sources :

Example 21 with CDateSet

use of com.bakdata.conquery.models.common.CDateSet in project conquery by bakdata.

the class CDateSetTest method testMaskedAddClosedMaskClosed.

@Test
public void testMaskedAddClosedMaskClosed() {
    CDateSet set = CDateSet.create();
    CDateSet mask = CDateSet.create(CDateRange.of(-10, 10));
    set.maskedAdd(CDateRange.of(-5, 5), mask);
    assertThat(set.asRanges()).containsExactly(CDateRange.of(-5, 5));
}
Also used : CDateSet(com.bakdata.conquery.models.common.CDateSet) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 22 with CDateSet

use of com.bakdata.conquery.models.common.CDateSet in project conquery by bakdata.

the class CDateSetTest method testMaskedAddClosedMaskAtMost.

@Test
public void testMaskedAddClosedMaskAtMost() {
    CDateSet set = CDateSet.create();
    CDateSet mask1 = CDateSet.create(CDateRange.of(10, 19));
    CDateSet mask2 = CDateSet.create(CDateRange.of(20, 30));
    set.maskedAdd(CDateRange.of(0, 5), mask1);
    set.maskedAdd(CDateRange.of(35, 36), mask2);
    assertThat(set.asRanges()).isEmpty();
}
Also used : CDateSet(com.bakdata.conquery.models.common.CDateSet) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

CDateSet (com.bakdata.conquery.models.common.CDateSet)22 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)11 Test (org.junit.jupiter.api.Test)9 ArrayList (java.util.ArrayList)4 CDateRange (com.bakdata.conquery.models.common.daterange.CDateRange)3 DateContext (com.bakdata.conquery.models.forms.util.DateContext)3 Aggregator (com.bakdata.conquery.models.query.queryplan.aggregators.Aggregator)3 OptionalInt (java.util.OptionalInt)3 EntityResult (com.bakdata.conquery.models.query.results.EntityResult)2 MultilineEntityResult (com.bakdata.conquery.models.query.results.MultilineEntityResult)2 List (java.util.List)2 Getter (lombok.Getter)2 ExportForm (com.bakdata.conquery.apiv1.forms.export_form.ExportForm)1 CQElement (com.bakdata.conquery.apiv1.query.CQElement)1 CQTable (com.bakdata.conquery.apiv1.query.concept.filter.CQTable)1 FilterValue (com.bakdata.conquery.apiv1.query.concept.filter.FilterValue)1 CPSType (com.bakdata.conquery.io.cps.CPSType)1 InternalOnly (com.bakdata.conquery.io.jackson.InternalOnly)1 NsIdRefCollection (com.bakdata.conquery.io.jackson.serializer.NsIdRefCollection)1 LocaleConfig (com.bakdata.conquery.models.config.LocaleConfig)1