package org.terst.feedreader.data import org.junit.Assert.assertEquals import org.junit.Test class SettingsTest { @Test fun `pinch zoom with scale factor of 1 leaves the font size unchanged`() { assertEquals(18, pinchZoomFontSizePx(18, 1.0f)) } @Test fun `pinching out scales the font size up, rounded to the nearest pixel`() { assertEquals(22, pinchZoomFontSizePx(20, 1.1f)) } @Test fun `pinching in scales the font size down, rounded to the nearest pixel`() { assertEquals(16, pinchZoomFontSizePx(20, 0.8f)) } @Test fun `pinch zoom result is clamped to the minimum reader font size`() { assertEquals(READER_FONT_SIZE_RANGE_PX.first, pinchZoomFontSizePx(14, 0.3f)) } @Test fun `pinch zoom result is clamped to the maximum reader font size`() { assertEquals(READER_FONT_SIZE_RANGE_PX.last, pinchZoomFontSizePx(28, 3.0f)) } }