package io.github.plastix.forage.util;

public class AngleUtilsTest {
}

@@ -37,36 +37,2429 @@
 l;%0A%0A
-public class AngleUtilsTest %7B
+import android.view.Display;%0Aimport android.view.Surface;%0Aimport android.view.WindowManager;%0A%0Aimport org.junit.Test;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class AngleUtilsTest %7B%0A%0A    @Test%0A    public void normalize_doesNotModifyNormalAngles() %7B%0A        float a = 0;%0A        float b = 360;%0A        float c = 180;%0A        float d = 145.86f;%0A%0A        assertThat(AngleUtils.normalize(a)).isWithin(0).of(a);%0A        assertThat(AngleUtils.normalize(b)).isWithin(0).of(a);%0A        assertThat(AngleUtils.normalize(c)).isWithin(0).of(c);%0A        assertThat(AngleUtils.normalize(d)).isWithin(0).of(d);%0A    %7D%0A%0A    @Test%0A    public void normalize_normalizesPositiveAngles() %7B%0A        float a = 361;%0A        float b = 456;%0A        float c = 720;%0A        float d = 945.5f;%0A%0A        assertThat(AngleUtils.normalize(a)).isWithin(0).of(1);%0A        assertThat(AngleUtils.normalize(b)).isWithin(0).of(96);%0A        assertThat(AngleUtils.normalize(c)).isWithin(0).of(0);%0A        assertThat(AngleUtils.normalize(d)).isWithin(0).of(225.5f);%0A    %7D%0A%0A    @Test%0A    public void normalize_normalizesNegativeAngles() %7B%0A        float a = -361;%0A        float b = -456;%0A        float c = -720;%0A        float d = -945.5f;%0A%0A        assertThat(AngleUtils.normalize(a)).isWithin(0).of(359);%0A        assertThat(AngleUtils.normalize(b)).isWithin(0).of(264);%0A        assertThat(AngleUtils.normalize(c)).isWithin(0).of(0);%0A        assertThat(AngleUtils.normalize(d)).isWithin(0).of(134.5f);%0A    %7D%0A%0A    @Test%0A    public void getRotationOffset_returnsCorrectRotation() %7B%0A        WindowManager windowManager = mock(WindowManager.class);%0A        Display display = mock(Display.class);%0A        when(windowManager.getDefaultDisplay()).thenReturn(display);%0A%0A        when(display.getRotation()).thenReturn(Surface.ROTATION_90);%0A        assertThat(AngleUtils.getRotationOffset(windowManager)).isEqualTo(90);%0A%0A        when(display.getRotation()).thenReturn(Surface.ROTATION_180);%0A        assertThat(AngleUtils.getRotationOffset(windowManager)).isEqualTo(180);%0A%0A        when(display.getRotation()).thenReturn(Surface.ROTATION_270);%0A        assertThat(AngleUtils.getRotationOffset(windowManager)).isEqualTo(270);%0A%0A%0A        when(display.getRotation()).thenReturn(Surface.ROTATION_0);%0A        assertThat(AngleUtils.getRotationOffset(windowManager)).isEqualTo(0);%0A%0A    %7D
 %0A%7D%0A

Add AngleUtils unit tests