GaseousAbsorptionAlgo { float[] getMassAir(float[] sza, float[] oza) { Assert.notNull(sza, "The sun zenith angel most not be null."); Assert.notNull(oza); float[] szaRad = SmileCorrectionUtils.convertDegreesToRadians(sza); float[] ozaRad = SmileCorrectionUtils.convertDegreesToRadians(oza); float[] massAirs = new float[sza.length]; for (int i = 0; i < sza.length; i++) { massAirs[i] = getMassAir(szaRad[i], ozaRad[i]); } return massAirs; }    }
@Test public void testGetMassAir() { float[] massAir = gaseousAbsorptionAlgo.getMassAir(new float[]{1, 2}, new float[]{3, 4}); assertEquals(2, massAir.length); assertArrayEquals(new float[]{2.0015247f, 2.0030515f}, massAir, 0); }
@Test(expected = NullPointerException.class) public void testGetMassAirNull() { float[] massAir = gaseousAbsorptionAlgo.getMassAir(null, new float[]{3, 4}); assertEquals(2, massAir.length); assertArrayEquals(new float[]{0.84070706f, -3.9328835f}, massAir, 0); fail("The sun zenith angel most not be null"); }
@Test public void testGetMassAirZero() { float[] massAir = gaseousAbsorptionAlgo.getMassAir(new float[]{0, 0}, new float[]{0, 0}); assertEquals(2, massAir.length); assertArrayEquals(new float[]{2, 2}, massAir, 0); }