Add more tests

This commit is contained in:
Manfred Karrer 2018-10-16 13:53:58 -05:00
parent dabe6907e1
commit d33298d087
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -44,6 +44,17 @@ public class ArbitratorSelectionTest {
arbitrators = new HashSet<>(Arrays.asList("arb1", "arb2", "arb3"));
result = ArbitratorSelection.getLeastUsedArbitrator(lastAddressesUsedInTrades, arbitrators);
assertEquals("arb1", result);
lastAddressesUsedInTrades = Arrays.asList("arb1", "arb2", "arb3", "arb1");
arbitrators = new HashSet<>(Arrays.asList("arb1", "arb2", "arb3"));
result = ArbitratorSelection.getLeastUsedArbitrator(lastAddressesUsedInTrades, arbitrators);
assertEquals("arb2", result);
lastAddressesUsedInTrades = Arrays.asList("arb1", "arb2", "arb3", "arb1", "arb2");
arbitrators = new HashSet<>(Arrays.asList("arb1", "arb2", "arb3"));
result = ArbitratorSelection.getLeastUsedArbitrator(lastAddressesUsedInTrades, arbitrators);
assertEquals("arb3", result);
lastAddressesUsedInTrades = Arrays.asList("xxx", "ccc", "aaa");
arbitrators = new HashSet<>(Arrays.asList("aaa", "ccc", "xxx"));
result = ArbitratorSelection.getLeastUsedArbitrator(lastAddressesUsedInTrades, arbitrators);