Print Page | Close Window

Unit testing in TFS and/or Resharper

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3304
Printed Date: 10-May-2024 at 6:36pm


Topic: Unit testing in TFS and/or Resharper
Posted By: Walid
Subject: Unit testing in TFS and/or Resharper
Date 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
projectfile:809AD660-30E8-4660-A09D-E2477DE27B22%2Ff%3AGestionAdministrative.IB.Designer.cs%3F33%3F1 - à WSoft.GestionAdministrative.Domain.FakeDossierAdministratifEntityManagerProvider.CreateEntityManager() dans projectfile:7F8E0A81-C1A0-41E8-980F-EF304F81E5A1%2Fd%3AEntityManagerProviders%2Ff%3AFakeDossierAdministratifEntityManagerProvider.cs%3F23%3F1 - à Cocktail.EntityManagerProviderBase`1.CreateEntityManagerCore() dans projectfile:65FCE695-2E91-4245-86D6-3FB3486AEFAD%2Ff%3AEntityManagerProviderBase.cs%3F210%3F1 - à Cocktail.EntityManagerProviderBase`1.get_Manager() dans projectfile:65FCE695-2E91-4245-86D6-3FB3486AEFAD%2Ff%3AEntityManagerProviderBase.cs%3F158%3F1 - à WSoft.Admissions.Test.Tests.ResetEntityManager() dans projectfile:748EA721-F76F-41D9-A002-8817ED042F18%2Ff%3ATests.cs%3F31%3F1 - à WSoft.Admissions.Test.Tests.CreatePatient() dans projectfile:748EA721-F76F-41D9-A002-8817ED042F18%2Ff%3ATests.cs%3F39%3F1 - public class FakeDossierAdministratifEntityManagerProvider : FakeStoreEntityManagerProviderBase<GestionAdministrativeEntities> { protected override GestionAdministrativeEntities CreateEntityManager() { =>> return new GestionAdministrativeEntities(compositionContextName: GestionAdministrativeContextResolver.DossierAdmministratifFake.Name); } }
Regards,



Replies:
Posted By: mgood
Date 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.


Posted By: Walid
Date Posted: 28-Feb-2012 at 1:33am
Ok, I will wait the .NET 4.5 Preview to see if it fix the issue.
 
Thanks.


-------------



Print Page | Close Window