Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented clone method, and unit test.

  • Loading branch information...
commit afa6f76fbe287b2428ec94c90bcc988a89853e55 1 parent 77d7d5d
@mikechambers authored
View
7 src/com/adobe/webapis/events/ServiceEvent.as
@@ -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;
+ }
}
}
View
11 tests/src/com/adobe/webapis/events/ServiceEventTest.as
@@ -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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.