It is currently Sat May 25, 2013 9:41 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Thu Nov 13, 2008 4:42 pm 
Offline
Advanced
Advanced

Joined: Thu Nov 13, 2008 4:33 pm
Posts: 23
I have been looking a using Isolator AAA syntax for testing sharepoint and it has gone very well.

I have one questions, is it possible to create a fake such as

SPSite fakeSite = Isolate.Fake.Instance<SPSite>(Members.ReturnRecursiveFakes);

inside a ASP.NET web page's constructor. The reason I ask is I was wondering if I could use Isolator to mock out all the MOSS calls made by a webpart, thus allowing it to be run inside a simple ASP.NET web page. This would allow a quick means to check styling/layout.

When I tried it I got the error

Could not load file or assembly 'TypeMock, Version=0.21321.16725.21324, Culture=neutral, PublicKeyToken=545950454d4f434b' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is will TypeMock 5.1.1 installed in the GAC and also the assemblies in the web sites local directory. I know the installation is good as MSTEST can use Isolator based tests without any issue.

I suspect sandboxing issue in the Cassini web server, but the version number in the exception did seem a bit strange.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 14, 2008 10:37 am 
Offline
Site Admin
Site Admin

Joined: Mon Nov 12, 2007 1:53 pm
Posts: 325
Hi Richard,

Let's take it offline. I sent a separate email regarding this issue.

Hoping to resolve this quickly,

_________________
Gil Zilberfeld
Typemock Support Team


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 9:48 am 
Offline
Newbie
Newbie

Joined: Mon Nov 17, 2008 9:43 am
Posts: 2
Goodmoring,

I have the same problem.
Is it possible that you also send me that email? Or post it here?

Greetings


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 10:14 am 
Offline
Site Admin
Site Admin

Joined: Thu May 18, 2006 12:03 pm
Posts: 904
Hi

Sure we will update you as well.

_________________
Regards

Ohad,
TypeMock Support Group


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 12:06 pm 
Offline
Site Admin
Site Admin

Joined: Thu May 18, 2006 12:03 pm
Posts: 904
Hi

It is generally not a good idea to fake things from within your production code (page_load). Instead, you can fake the HTTPContext from inside your test (before initializing your web part to test it)

the reason is that the page_load could be called many times within one test by the ASP.NET runtime, and you only want to "fake" things once in your test.

You might want to take a look at Ivonna, which allows to easily test and fake web forms along with HTTPContext (built on top of Typemock Isolator).

_________________
Regards

Ohad,
TypeMock Support Group


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 17, 2008 1:55 pm 
Offline
Advanced
Advanced

Joined: Thu Nov 13, 2008 4:33 pm
Posts: 23
The only reason I was trying this was try to create a create a 'quick preview' of what a webpart will render as for addressing CSS style sheet etc. issues. This is a test harness where the testing tool is the designers eyes.

The reason for this is that the 'cost' in time to deploy webpart that calls Sharepoint is expensive and I thought to mock out the Sharepoint calls, but leave a 'real web server' to do the HTML /ajax rendering much be the answer. So it is not really production code. I would go as far to say as I doubt it would even be used to handle a post back, just a visual page inspection.

This all said Ivonna does look interesting, but I am not esure it addresses the question of 'are all the text boxes in line'


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 18, 2008 3:59 pm 
Offline
Site Admin
Site Admin

Joined: Thu May 18, 2006 12:03 pm
Posts: 904
Hi

Now I see what you are trying to do.

The solution you sent reproduces the error you reported.
We are looking into it, I will update as soon as we will find something.

_________________
Regards

Ohad,
TypeMock Support Group


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 23, 2008 11:15 am 
Offline
Site Admin
Site Admin

Joined: Thu May 18, 2006 12:03 pm
Posts: 904
Hi

We created a patch and sent it.
Please check it out and tell me if it works.

_________________
Regards

Ohad,
TypeMock Support Group


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 6:58 am 
Offline
Newbie
Newbie

Joined: Mon Nov 17, 2008 9:43 am
Posts: 2
Hi,

You're patch is working.

Great job.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.060s | 13 Queries | GZIP : Off ]