New Posts New Posts RSS Feed: Unit Testing and XML serialization
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Unit Testing and XML serialization

 Post Reply Post Reply
Author
downeytim View Drop Down
Newbie
Newbie


Joined: 08-Dec-2009
Location: Dallas, Texas
Posts: 18
Post Options Post Options   Quote downeytim Quote  Post ReplyReply Direct Link To This Post Topic: Unit Testing and XML serialization
    Posted: 16-Mar-2010 at 6:10am
Is there any way to create an XML file that contains entities to be used to load the EntityManager with and run unit tests.  We want to create a "mock" situation where we can run unit tests without have a DB present.  We want to create an XML file that contains the data for the tests, load it into a disconnected EntityManager, run our tests and check the results.
 
 
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 07-Apr-2010 at 5:56pm
Tim,
 
Yes, one of our customers did exactly this when developing the UFC Gyms Touch App and performed development and testing without the database. 
  1. First, you need to get some sample entities.  Either query them from a real database or alternatively, create new entities, set their properties, and add them to the EntityManager.
  2. Second, save the EntityManager's cache to a file by calling EntityManager.CacheStateManager.SaveCacheState().
  3. Now you can load the cache using RestoreCacheState() and operate fully disconnected from the database.
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down