 import dolly.data.ClassLevelCloneable;
 import dolly.data.ClassLevelCopyableCloneable;
 import dolly.data.PropertyLevelCloneable;
+import dolly.data.PropertyLevelCopyableCloneable;
 
 import org.as3commons.reflect.Field;
 import org.as3commons.reflect.Type;


	private var propertyLevelCloneable:PropertyLevelCloneable;
	private var propertyLevelCloneableType:Type;

	[Before]
	public function before():void {

		assertEquals(4, cloneableFields.length);

		cloneableFields = Cloner.getCloneableFieldsForType(propertyLevelCloneableType);
		assertNotNull(cloneableFields);
		assertEquals(3, cloneableFields.length);

		cloneableFields = Cloner.getCloneableFieldsForType(propertyLevelCopyableCloneableType);
		assertNotNull(cloneableFields);
		assertEquals(4, cloneableFields.length);
	}

	[Test]
	public function testCloneWithClassLevelMetadata():void {
		const clone1:ClassLevelCloneable = Cloner.clone(classLevelCloneable);
		assertNotNull(clone1);
		assertNotNull(clone1.property1);
		assertEquals(clone1.property1, classLevelCloneable.property1);
		assertNotNull(clone1.property2);
		assertEquals(clone1.property2, classLevelCloneable.property2);
		assertNotNull(clone1.property3);
		assertEquals(clone1.property3, classLevelCloneable.property3);
		assertNotNull(clone1.writableField);
		assertEquals(clone1.writableField, classLevelCloneable.writableField);

		const clone2:ClassLevelCopyableCloneable = Cloner.clone(classLevelCopyableCloneable);
		assertNotNull(clone2);
		assertNotNull(clone2.property1);
		assertEquals(clone2.property1, classLevelCloneable.property1);
		assertNotNull(clone2.property2);
		assertEquals(clone2.property2, classLevelCloneable.property2);
		assertNotNull(clone2.property3);
		assertEquals(clone2.property3, classLevelCloneable.property3);
		assertNotNull(clone2.writableField);
		assertEquals(clone2.writableField, classLevelCloneable.writableField);
	}

	[Test]
	public function testCloneWithPropertyLevelMetadata():void {
		const clone1:PropertyLevelCloneable = Cloner.clone(propertyLevelCloneable);
		assertNotNull(clone1);
		assertNull(clone1.property1);
		assertNotNull(clone1.property2);
		assertEquals(clone1.property2, propertyLevelCloneable.property2);
		assertNotNull(clone1.property3);
		assertEquals(clone1.property3, propertyLevelCloneable.property3);
		assertNotNull(clone1.writableField);
		assertEquals(clone1.writableField, propertyLevelCloneable.writableField);

		const clone2:PropertyLevelCopyableCloneable = Cloner.clone(propertyLevelCopyableCloneable);
		assertNotNull(clone2);
		assertNotNull(clone2.property1);
		assertEquals(clone2.property1, propertyLevelCloneable.property1);
		assertNotNull(clone2.property2);
		assertEquals(clone2.property2, propertyLevelCloneable.property2);
		assertNotNull(clone2.property3);
		assertEquals(clone2.property3, propertyLevelCloneable.property3);
		assertNotNull(clone2.writableField);
		assertEquals(clone2.writableField, propertyLevelCloneable.writableField);
	}
}
}