|
|
|
|
@ -110,8 +110,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyBankroll() |
|
|
|
|
val filterElementRow = QueryCondition.AnyBankroll().apply { setObject(b1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Bankroll |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.Bankroll)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -141,11 +140,9 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyBankroll() |
|
|
|
|
val filterElementRow = QueryCondition.AnyBankroll().apply { setObject(b1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Bankroll |
|
|
|
|
|
|
|
|
|
val filterElementRow2 = QueryCondition.AnyBankroll().apply { setObject(b2) } |
|
|
|
|
filterElementRow2.filterSectionRow = FilterSectionRow.Bankroll |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2))) |
|
|
|
|
|
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow, filterElementRow2), FilterSectionRow.Bankroll)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -169,7 +166,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
realm.commitTransaction() |
|
|
|
|
|
|
|
|
|
val anyGame = QueryCondition.AnyGame(g2) |
|
|
|
|
val fc = FilterCondition(filterElementRows = arrayListOf(anyGame)) |
|
|
|
|
val fc = FilterCondition(arrayListOf(anyGame), FilterSectionRow.Game) |
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(fc.queryCondition)) |
|
|
|
|
|
|
|
|
|
Assert.assertEquals(1, sessions.size) |
|
|
|
|
@ -197,10 +194,10 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
realm.commitTransaction() |
|
|
|
|
|
|
|
|
|
val filterElementRow = QueryCondition.AnyGame().apply { setObject(g2) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Game |
|
|
|
|
val filterElementRow2 = QueryCondition.AnyGame().apply { setObject(g3) } |
|
|
|
|
filterElementRow2.filterSectionRow = FilterSectionRow.Game |
|
|
|
|
val filterCondition = FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2)) |
|
|
|
|
|
|
|
|
|
val filterCondition = FilterCondition(arrayListOf(filterElementRow, filterElementRow2), FilterSectionRow.Game) |
|
|
|
|
|
|
|
|
|
val queryCondition = filterCondition.queryCondition |
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(queryCondition)) |
|
|
|
|
|
|
|
|
|
@ -225,8 +222,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyLocation() |
|
|
|
|
val filterElementRow = QueryCondition.AnyLocation().apply { setObject(l1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Location |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.Location)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -257,11 +253,9 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
val filter = QueryCondition.AnyLocation() |
|
|
|
|
|
|
|
|
|
val filterElementRow = QueryCondition.AnyLocation().apply { setObject(l1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Location |
|
|
|
|
val filterElementRow2 = QueryCondition.AnyLocation().apply { setObject(l3) } |
|
|
|
|
filterElementRow2.filterSectionRow = FilterSectionRow.Location |
|
|
|
|
|
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow, filterElementRow2), FilterSectionRow.Location)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -287,8 +281,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
val filter = QueryCondition.AnyTournamentName() |
|
|
|
|
|
|
|
|
|
val filterElementRow = QueryCondition.AnyTournamentName().apply { setObject(t1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TournamentName |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.TournamentName)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -318,10 +311,8 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyTournamentName() |
|
|
|
|
val filterElementRow = QueryCondition.AnyTournamentName().apply { setObject(t1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TournamentName |
|
|
|
|
val filterElementRow2 = QueryCondition.AnyTournamentName().apply { setObject(t2) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TournamentName |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow, filterElementRow2), FilterSectionRow.TournamentName)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -354,12 +345,10 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AllTournamentFeature() |
|
|
|
|
val filterElementRow = QueryCondition.AllTournamentFeature().apply { setObject(t1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
val filterElementRow2 = QueryCondition.AllTournamentFeature().apply { setObject(t2) } |
|
|
|
|
filterElementRow2.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
val filterElementRow3 = QueryCondition.AllTournamentFeature().apply { setObject(t4) } |
|
|
|
|
filterElementRow3.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2, filterElementRow3))) |
|
|
|
|
|
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow, filterElementRow2, filterElementRow3), FilterSectionRow.TournamentFeature)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -389,14 +378,11 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyTournamentFeature() |
|
|
|
|
val filterElementRow = QueryCondition.AnyTournamentFeature().apply { setObject(t1) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
val filterElementRow2 = QueryCondition.AnyTournamentFeature().apply { setObject(t2) } |
|
|
|
|
filterElementRow2.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
val filterElementRow3 = QueryCondition.AnyTournamentFeature().apply { setObject(t3) } |
|
|
|
|
filterElementRow3.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
val filterElementRow4 = QueryCondition.AnyTournamentFeature().apply { setObject(t4) } |
|
|
|
|
filterElementRow4.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2, filterElementRow3, filterElementRow4))) |
|
|
|
|
|
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow, filterElementRow2, filterElementRow3, filterElementRow4), FilterSectionRow.TournamentFeature)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -423,8 +409,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyTournamentFeature() |
|
|
|
|
val filterElementRow = QueryCondition.AnyTournamentFeature().apply { setObject(t2) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TournamentFeature |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.TournamentFeature)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -448,10 +433,9 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.AnyTableSize() |
|
|
|
|
val filterElementRow = QueryCondition.AnyTableSize().apply { listOfValues = arrayListOf(2) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TableSize |
|
|
|
|
val filterElementRow2 = QueryCondition.AnyTableSize().apply { listOfValues = arrayListOf(4) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.TableSize |
|
|
|
|
filter.updateValueBy(FilterCondition(filterElementRows = arrayListOf(filterElementRow, filterElementRow2))) |
|
|
|
|
|
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow, filterElementRow2), FilterSectionRow.TableSize)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -475,8 +459,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.NetAmountWon() |
|
|
|
|
val filterElementRow = QueryCondition.more<QueryCondition.NetAmountWon>().apply { listOfValues = arrayListOf(204.0) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Value |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.Value)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filterElementRow)) |
|
|
|
|
|
|
|
|
|
@ -500,8 +483,7 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filter = QueryCondition.NetAmountWon() |
|
|
|
|
val filterElementRow = QueryCondition.less<QueryCondition.NetAmountWon>().apply { listOfValues = arrayListOf(540.0) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Value |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow))) |
|
|
|
|
filter.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.Value)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filter)) |
|
|
|
|
|
|
|
|
|
@ -525,13 +507,11 @@ class SessionFilterInstrumentedUnitTest : BaseFilterInstrumentedUnitTest() { |
|
|
|
|
|
|
|
|
|
val filterMore = QueryCondition.NetAmountWon() |
|
|
|
|
val filterElementRow = QueryCondition.more<QueryCondition.NetAmountWon>().apply { listOfValues = arrayListOf(199.0) } |
|
|
|
|
filterElementRow.filterSectionRow = FilterSectionRow.Value |
|
|
|
|
filterMore.updateValueBy(FilterCondition(arrayListOf(filterElementRow))) |
|
|
|
|
filterMore.updateValueBy(FilterCondition(arrayListOf(filterElementRow), FilterSectionRow.Value)) |
|
|
|
|
|
|
|
|
|
val filterLess = QueryCondition.NetAmountWon() |
|
|
|
|
val filterElementRow2 = QueryCondition.less<QueryCondition.NetAmountWon>().apply { listOfValues = arrayListOf(400.0) } |
|
|
|
|
filterElementRow2.filterSectionRow = FilterSectionRow.Value |
|
|
|
|
filterLess.updateValueBy(FilterCondition(arrayListOf(filterElementRow2))) |
|
|
|
|
filterLess.updateValueBy(FilterCondition(arrayListOf(filterElementRow2), FilterSectionRow.Value)) |
|
|
|
|
|
|
|
|
|
val sessions = Filter.queryOn<Session>(realm, Query(filterMore, filterLess)) |
|
|
|
|
|
|
|
|
|
|