Permalink
Browse files

Implemented clone method, and unit test.

  • Loading branch information...
1 parent 77d7d5d commit afa6f76fbe287b2428ec94c90bcc988a89853e55 @mikechambers committed Sep 21, 2009
@@ -70,6 +70,13 @@ package com.adobe.webapis.events
_data = d;
}
+ public override function clone():Event
+ {
+ var out:ServiceEvent = new ServiceEvent(type, bubbles, cancelable);
+ out.data = data;
+
+ return out;
+ }
}
}
@@ -43,7 +43,16 @@ package com.adobe.webapis.events
public function test_clone():void
{
- assertTrue(false);
+ var type:String = "foo";
+ var o:Object = {foo:"bar"};
+
+ var original:ServiceEvent = new ServiceEvent(type);
+
+ var clone:ServiceEvent = ServiceEvent(original.clone());
+
+ assertTrue("original != clone", original != clone);
+ assertTrue("clone.type == original.type", clone.type == original.type);
+ assertTrue("clone.type == original.type", clone.data == original.data);
}
}

0 comments on commit afa6f76

Please sign in to comment.