Print Page | Close Window

Does Faking need the BOS?

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2846
Printed Date: 12-Apr-2026 at 7:26am


Topic: Does Faking need the BOS?
Posted By: cseils
Subject: Does Faking need the BOS?
Date Posted: 25-Jul-2011 at 5:50pm
Hello,

I am created an EntityManager in a unit test using the CompositionContext.Fake with the following line of code:

var em = new DomainModelEntityManager(compositionContextName: CompositionContext.Fake.Name);

This works fine when running the silverlight unit test runner from the browser.
However when I run this from Devexpress's Coderush Test runner, I get the white screen of death and in the StatLight test runner, I get the more informed error of:

An unknown request was made to the StatLight's web server. You may want to check your test project for what generated the following request.
********** Request Information **********
       Url : http://localhost:8887/EntityService.svc/sl

Is it possible to use faking this way without the Business object server running?  

Thanks
Chris




Replies:
Posted By: kimj
Date Posted: 28-Jul-2011 at 8:42am
Hi Chris,
 
Unfortunately, faking in Silverlight does need the BOS, since the faking implementation is making async calls to the server where the fake store is located.   Since this isn't realistic with an automated test runner, another approach for your unit tests might be to use a disconnected EntityManager with preloaded test data, say from an EntityCacheState.  Some of the code samples take this approach, one being the "Querying" sample at http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-querying - http://drc.ideablade.com/xwiki/bin/view/Documentation/code-sample-querying .
  



Print Page | Close Window