@Test
public void addUniverseElementsToUniverseElementComposite() throws Exception
{
TestUElementComposite testElementToAdd = new TestUElementComposite();
TestUElementComposite emptyTestElement = new TestUElementComposite();
TestUElement testElementToAdd2 = new TestUElement();
assertFalse(
"Prior to adding a UniverseElementComposite to another UniverseElementComposite, the potential child UniverseElementComposite should not report itself as being contained within another UniverseElementComposite",
testElementToAdd.isContained() );
assertFalse(
"Prior to adding a UniverseElement to a UniverseElementComposite, the UniverseElement should report itself as not being contained.",
testElementToAdd2.isContained() );
assertTrue(
"Adding a UniverseElementComposite to an empty UniverseElementComposite should return true",
testElement.add( testElementToAdd ) );
assertFalse(
"A UniverseElementComposite that has had an element added should not be similar to a UniverseElementComposite that has no nodes.",
testElement.similar( emptyTestElement ) );
assertFalse(
"A UniverseElementComposite that has an element should not be marked as empty.",
testElement.isEmpty() );
assertEquals(
"A UniverseElementComposite that has exactly one element should report a size of one.",
testElement.size(), 1 );
assertFalse(
"Trying to add a UniverseElementComposite twice to a UniverseElementComposite should return false",
testElement.add( testElementToAdd ) );
assertEquals(
"After trying to add a UniverseElementComposite twice to a UniverseElementComposite should leave the original UniverseElementComposite (the parent) with a size of 1.",
testElement.size(), 1 );
assertFalse(
"Trying to add a UniverseElementComposite to two different UniverseElementComposites should return false.",
emptyTestElement.add( testElementToAdd ) );
assertTrue(
"After trying to add a UniverseElementComposite to two different UniverseElementComposites (the second being initially empty), the second UniverseElementComposite should still be empty.",
emptyTestElement.isEmpty() );
assertTrue(
"We should be able to add an element to a different UniverseElementComposite after having already added a different UniverseElement to a different UniverseElementComposite.",
emptyTestElement.add( testElementToAdd2 ) );
assertFalse(
"Having one UniverseElementComposite in another, then adding a different UniverseElement to a different UniverseElementComposite should leave the second parent UniverseElementComposite in a non-empty state.",
emptyTestElement.isEmpty() );
assertTrue(
"Adding a second unique element to a UniverseElementComposite should return true.",
testElement.add( emptyTestElement ) );
assertEquals(
"Adding a second element to a UniverseElementComposite should leave the UniverseElementComposite with a size of 2.",
testElement.size(), 2 );
assertTrue(
"Having added one UniverseElementComposite to another, the added element should be reported itself as being contained by another UniverseElementComposite class.",
testElementToAdd.isContained() );
assertTrue(
"Having added a UniverseElement to a UniverseElementComposite, the UniverseElement should report itself as being contained.",
testElementToAdd2.isContained() );
}