//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldBeAbleToChangeSlotSize() internal virtual void ShouldBeAbleToChangeSlotSize() { // GIVEN PackedMultiFieldCache cache = new PackedMultiFieldCache(5, 1); int index = 10; assertThrows(typeof(System.ArgumentException), () => cache.put(index, 2, 0)); // WHEN cache.setSlotSizes(8, 8, 10); // THEN cache.Put(index, 2, 10); assertEquals(10, cache.Get(index, 2)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldPutValuesIntoSlots() internal virtual void ShouldPutValuesIntoSlots() { // GIVEN PackedMultiFieldCache cache = new PackedMultiFieldCache(8, 16, 24, 32, 1); int index = 10; long[] values = new long[] { 3, 100, 12345, 67890, 0 }; // WHEN cache.Put(index, values); // THEN for (int i = 0; i < values.Length; i++) { assertEquals(values[i], cache.Get(index, i)); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldHandleTwoIdsAndFourBooleans() internal virtual void ShouldHandleTwoIdsAndFourBooleans() { // given PackedMultiFieldCache cache = new PackedMultiFieldCache(ID_SLOT_SIZE, ID_SLOT_SIZE, 1, 1, 1, 1); int index = 3; // when long v1 = (1L << ID_SLOT_SIZE) - 10; long v2 = (1L << ID_SLOT_SIZE) - 100; cache.Put(index, v1, v2, 0, 1, 0, 1); // then assertEquals(v1, cache.Get(index, 0)); assertEquals(v2, cache.Get(index, 1)); assertEquals(0, cache.Get(index, 2)); assertEquals(-1, cache.Get(index, 3)); assertEquals(0, cache.Get(index, 4)); assertEquals(-1, cache.Get(index, 5)); }