Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Fabrication / Fabrication UnitTestCase on: September 01, 2009, 04:16:23
Hi All,
Im trying to write a testcase for my Loginproxy. My proxy has LoginServiceCallAMF method  to call server API with the corresponding result and fault handler. This is working fine.
:
My Login Proxy extends FabricationProxy
{
public function LoginServiceCallAMF(username:String , password:String):void{
RemoteObject - Call the server method
}
public function resultAMF(data:Object):void{
sendNotification(LOGIN_SUCESS);
}
public function faultAMF(info:Object):void{
sendNotification(LOGIN_FAIL);
}     
}
I got struck while coming into testing. I tried the Mock approach from Fabrication UnitTest source.
Created Mock for Login Proxy.
In the Login Proxy test case
:
override public function setUp():void {
key = methodName + "_setup";

_fabrication = new FabricationMock();
facade = FabricationFacadeMock.getInstance(key);
fabricationModel = new FabricationModel(key);
fabricationModel = FabricationModelMock.getInstance(key);

proxy = (new LoginProxyMock(key) as LoginProxy);
proxy.initializeNotifier(key);

facade.registerProxy(proxy);
}
public function LoginProxyEvent():void{
assertEquals('ConcordanceLoginProxy',facade.retrieveProxy(ConcordanceLoginProxy.NAME).getProxyName())
}
The result I’m getting for this test is
Error #1009: Cannot access a property or method of a null object reference.

I’m not sure that I’m in right track.  Also I tried this in puremvc with the help of the sample provided here http://www.hufkens.net/2009/07/testing-puremvc-code-with-flexunit/. This works perfect.
Could someone help me out to resolve this?

Thanks in advance.
 jk


2  Announcements and General Discussion / Fabrication / Re: Flex unit Testing for Fabrication on: August 20, 2009, 08:53:49
Yeah, i looked at the fabrication test cases but still am not having a clear idea to start with. Thats why looking for some samples. Any luck that i can get some source?
3  Announcements and General Discussion / Fabrication / Flex unit Testing for Fabrication on: August 19, 2009, 08:43:57
How can i write a test case to test the notifications and how to test the modules?Please share ideas on this.
Pages: [1]