New Posts New Posts RSS Feed: Unit testing in TFS and/or Resharper
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Unit testing in TFS and/or Resharper

 Post Reply Post Reply
Author
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Topic: Unit testing in TFS and/or Resharper
    Posted: 27-Feb-2012 at 12:25pm
Hi,
I'd like to do some Unit Testing in my Silverlight 5 application. I created a test project based on the Template from the Silverlight 5 Toolkit.
When I run the tests through the test application it works fine but when I try to run them within TFS 2010 or resharper it crash everytime I try to create a new EntityManager.
Note : I am using a FakeEntityManager if that matters, as described in the TempHire application. I tried to instance directly my entityManager and I get the same error
Is there some specific configuration to do in order to be able to run the tests in resharper and/or TFS ? I found an old post about this subject from Ward Bell (from 2009) on this forum but I have to admit I didn't manage to do what he explained. Is this post still up to date ?
Any idea ?
Here is the trace :
System.Exception: Défaillance irrémédiable (Exception de HRESULT : 0x8000FFFF (E_UNEXPECTED))
à MS.Internal.XcpImports.CheckHResult(UInt32 hr)
à MS.Internal.XcpImports.Application_GetCurrent(ref IntPtr pApp)
à System.Windows.Application.get_Current()
à IdeaBlade.Core.IdeaBladeConfig.InitializeFromSource()
à IdeaBlade.Core.IdeaBladeConfig.Initialize()
à IdeaBlade.Core.IdeaBladeConfig.get_Instance()
à IdeaBlade.Core.IdeaBladeConfig.AssertNonDefaultVersion(Boolean throwIfDefault)
à IdeaBlade.EntityModel.EntityManager..ctor(EntityManagerContext context)
à IdeaBlade.EntityModel.EntityManager..ctor(Boolean shouldConnect, String dataSourceExtension, EntityServiceOption entityServiceOption, String compositionContextName)
à WSoft.GestionAdministrative.Domain.GestionAdministrativeEntities..ctor(Boolean shouldConnect, String dataSourceExtension, EntityServiceOption entityServiceOption, String compositionContextName) dans
GestionAdministrative.IB.Designer.cs: line 33
à WSoft.GestionAdministrative.Domain.FakeDossierAdministratifEntityManagerProvider.CreateEntityManager() dans FakeDossierAdministratifEntityManagerProvider.cs: line 23
à Cocktail.EntityManagerProviderBase`1.CreateEntityManagerCore() dans EntityManagerProviderBase.cs: line 210
à Cocktail.EntityManagerProviderBase`1.get_Manager() dans EntityManagerProviderBase.cs: line 158
à WSoft.Admissions.Test.Tests.ResetEntityManager() dans Tests.cs: line 31
à WSoft.Admissions.Test.Tests.CreatePatient() dans Tests.cs: line 39
Here is the line where the error occurs :
    public class FakeDossierAdministratifEntityManagerProvider : FakeStoreEntityManagerProviderBase<GestionAdministrativeEntities>
    {
        protected override GestionAdministrativeEntities CreateEntityManager()
        {
=>>       return new GestionAdministrativeEntities(compositionContextName: GestionAdministrativeContextResolver.DossierAdmministratifFake.Name);
        }
    }
Regards,
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 27-Feb-2012 at 1:45pm
I'm pretty sure you are running into the same issues we did with design time data in Silverlight 5. The problem here is that Resharper and TFS are trying to interpret the Silverlight application against the .NET runtime. The same happens in Blend.
The problem is Silverlight 5 added a number of methods that are missing in .NET 4. So, trying to interpret a DevForce Silverlight 5 app against .NET 4 fails with MissingMethod exceptions.
 
Unfortunately, this won't work until .NET 4.5 comes out and all the tools have been updated.
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 28-Feb-2012 at 1:33am
Ok, I will wait the .NET 4.5 Preview to see if it fix the issue.
 
Thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down