@Test public void testXPDFSampleParametersXPDFSampleParameters() { XPDFSampleParameters copy = new XPDFSampleParameters(sample); assertEquals(sample.getName(), copy.getName()); assertEquals(sample.getPhases(), copy.getPhases()); assertEquals(sample.getPhaseWeightings(), copy.getPhaseWeightings()); assertEquals(sample.isSample(), copy.isSample()); assertEquals(sample.getComposition(), copy.getComposition()); assertEquals(sample.getDensity(), copy.getDensity(), 1e-3); assertEquals(sample.getPackingFraction(), copy.getPackingFraction(), 1e-3); assertEquals(sample.getShapeName(), copy.getShapeName()); }
@Test public void testXPDFSampleParametersBoolean() { sample = new XPDFSampleParameters(true); testBasicFieldCreation(); assertTrue( "XPDFSampleParameters sample parameter not set correctly on construction", sample.isSample()); sample = null; sample = new XPDFSampleParameters(false); testBasicFieldCreation(); assertTrue( "XPDFSampleParameters sample parameter not unset correctly on construction", !sample.isSample()); }
@Test public void testSetAsContainer() { sample.setAsContainer(); assertFalse("Not successfully set as a container", sample.isSample()); }
@Test public void testSetIsSample() { sample.setAsContainer(); sample.setAsSample(); assertTrue("Not successfully set as a sample", sample.isSample()); }