Questions tagged [asmock]

asMock is a dynamic mock object framework for AS3 application's on the Flash/Flex platform. asMock's purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

asMock is a dynamic mock object framework for AS3 application's on the Flash/Flex platform. asMock's purpose is to ease testing by allowing the developer to create mock implementations of custom objects and verify the interactions using unit testing.

12 questions
1
vote
1 answer

ASMock: VerifyError for flash.net.NetGroup

I have been using ASMock in combination with Flexunit4.1 to create automated tests for my project. However, when I tryto mock a flash.net.NetGroup I get the following error message: VerifyError: Error #1053: Illegal override of…
Kevin
  • 133
  • 1
  • 1
  • 5
1
vote
2 answers

mocking the static methods and private members using asmock

1.Is there any way to access the private data members of a class in action script using asmock framework? I tried using syntax like ContentPlayer[“getContentPlayer”]=mockContentPlayer; Where in getContentPlayer is a private member and…
0
votes
1 answer

How do I make one of a stub's method call the real method in ASMock?

In flex I want to do something similar to the following var audioPlayerMock:AudioPlayer =…
Lango
  • 2,995
  • 5
  • 26
  • 27
0
votes
2 answers

Using asMock, how can I satisfy a concrete and interface requirement in SetupResult.forCall

The ValidationManager has a public Dictionary for storing UI components that implement the IValidatable interface. I am testing a command class that needs an instance of ValidationManager and I want it to fail the validations. So I override the…
Tony Smith
  • 869
  • 1
  • 11
  • 25
0
votes
1 answer

PureMVC / complicated asMock

Ok - I've got a bit of a complicated asMock setup here; I've got a PureMVC async command that is attempting to call another class that implements interfaces in order to set up some asmocks for development without the backend. import…
grimmwerks
  • 491
  • 1
  • 6
  • 21
0
votes
1 answer

FlashDevelop ASMock integration errors

I've recently been trying to use ASMock 1.0 with ASUnit4.0 (I grabbed the package with both of them together off of the ASMock website) and added both .swc components (asmock-v1.0.swc and asmock-v1.0-asunit-v4.0.swc) to the lib folder of my…
user489162
0
votes
2 answers

Can't get ASMock to Dipatch Events

I can't find my mistake, hope someone can help me out. I am trying to unit test my actionscript application using ASMock. I want to perform an asynchron test, but I don't get my mocked function to dispatch. this is what I…
0
votes
2 answers

How to integrate AsMock into AsUnit 4?

Trying to update AsMock mocking framework to v.1.0, and use it with AsUnit 4. But in runtime get a VerifyError (1153, inacceptible override) at the line with [RunWith("asmock.integration.asunit.ASMockRunner")] metatag in the test case class. I use…
lanferna
  • 1
  • 1
0
votes
1 answer

Is replay() and replayAll() necessary for asmock?

looking at asmock examples (http://asmock.sourceforge.net/wiki/Quick_Start_Guide) i noticed that whenever the setup of the mock is complete (settings of returnValue etc) replay or replayall is called. I am not sure of what is the purpose of calling…
Eran
  • 1,628
  • 16
  • 31
0
votes
1 answer

asmock Previous method requires a return value or an exception to throw

Trying to get my head around asmock to implement some unit testing in my project. I want to test my MainMediator and since there are objects that get created in my MainMediator onRegister call, I'm thinking that I should mock those…
m.y
  • 691
  • 9
  • 21
0
votes
1 answer

Unittesting and mocking robotlegs service calls using Oil extension

I have an ExampleModel that calls to an ExampleService that retrieves data from our backend. I can't figure out how to write unit tests for my application; which is structured as shown below: ExampleService public function…
m.y
  • 691
  • 9
  • 21
0
votes
2 answers

Simulating as3 dispatch events for unit testing

I'm writing some unit test and would like to test how my components are reacting to some specific flash events. So I need a way to dispatch those events. I think that that's possible. I'm trying to use asmock but trying to piece together info from…
m.y
  • 691
  • 9
  • 21