But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

Thoughts on the new Skydrive

I have swapped to the new version of Microsoft Skydrive, replacing my old Mesh setup. It is a nice slick experience, allowing easy viewing of files on Skydrive from Windows and WP7. However, I do have couple of issues

  1. I used Mesh to sync photos from my Window 7 Media Center up to cloud storage as a backup, don’t want to loose all the family photos due to a disk failure. This was simple with Mesh, just set up a sync. This is not so easy with the new Skydrive, which appears only as a folder in your user area. The only solution I can spot is to copy my photos into this folder e.g. xcopy d:\photos c:\users\richard\skydrive\photos. Once the copy is done this will be synced up to the cloud. With mesh if I added a file to my PC it sync’d without me doing anything, now I need to remember the xcopy (or whatever sync copy tool I am using), or have the copy being run on a regular basis via a timer.
  2. Letting Skydrive start automatically on a laptop Windows PC is dangerous. I was on site today using my Mifi and in about 10 minutes used a whole days credit. So I would recommend changing your tool tray setting to make sure you can see the Skydrive icon all the time, so you have a chance see when it is syncing and can stop it when on a connection that cost you money.

image

So any comments, or better ways to do the sync?

My video on using Team Explorer Everywhere is published on Channel9

I recently recorded a video on using Visual Studio Team Explorer Everywhere, this has today been published in the UK Techdays section of Channel 9.

 

Hope you find it useful.

Back from holiday to find my DDD Southwest session has been accepted

Got back from holiday today to find my DDDSW (26th May) session on unit testing in Visual Studio 11 has been accepted.

I see the event is already full, but hope to see some of you there

Fix for problem faking two SPLists in a single unit test with Typemock Isolator has been released

A blogged a while ago about a problem faking multiple SPList with Typemock Isolator in a single test. With the release of Typemock Isolator 7.0.4.0 you no longer have to use the workaround I documented.

You can now use the code if the originally planned, and it works as expected

   1: public partial class TestPage : System.Web.UI.Page
2: {
3: public TestPage()
4: {
5:  var fakeWeb = Isolate.Fake.Instance<SPWeb>();

7: Isolate.WhenCalled(() => SPControl.GetContextWeb(null)).WillReturn(fakeWeb);
8: 
9: // return value for 1st call
10: Isolate.WhenCalled(() => fakeWeb.Lists["Centre Locations"].Items).WillReturnCollectionValuesOf(CreateCentreList());
11: // return value for all other calls
12: Isolate.WhenCalled(() => fakeWeb.Lists["Map Zoom Areas"].Items).WillReturnCollectionValuesOf(CreateZoomAreaList());
13: }
14: 
15: private static List<SPListItem> CreateZoomAreaList()
16: {
17: var fakeZoomAreas = new List<SPListItem>();
18: fakeZoomAreas.Add(CreateZoomAreaSPListItem("London", 51.49275, -0.137722222, 2, 14));
19: return fakeZoomAreas;
20: }
21: 
22: private static List<SPListItem> CreateCentreList()
23: {
24: var fakeSites = new List<SPListItem>();
25: fakeSites.Add(CreateCentreSPListItem("Aberdeen ", "1 The Road, Aberdeen ", "Aberdeen@test.com", "www.Aberdeen.test.com", "1111", "2222", 57.13994444, -2.113333333));
26: fakeSites.Add(CreateCentreSPListItem("Altrincham ", "1 The Road, Altrincham ", "Altrincham@test.com", "www.Altrincham.test.com", "3333", "4444", 53.38977778, -2.349916667));
27: return fakeSites;
28: }
29: 
30: private static SPListItem CreateCentreSPListItem(string title, string address, string email, string url, string telephone, string fax, double lat, double lng)
31: {
32: var fakeItem = Isolate.Fake.Instance<SPListItem>();
33: Isolate.WhenCalled(() => fakeItem["Title"]).WillReturn(title);
34: Isolate.WhenCalled(() => fakeItem["Address"]).WillReturn(address);
35: Isolate.WhenCalled(() => fakeItem["Email Address"]).WillReturn(email);
36: Isolate.WhenCalled(() => fakeItem["Site URL"]).WillReturn(url);
37: Isolate.WhenCalled(() => fakeItem["Telephone"]).WillReturn(telephone);
38: Isolate.WhenCalled(() => fakeItem["Fax"]).WillReturn(fax);
39: Isolate.WhenCalled(() => fakeItem["Latitude"]).WillReturn(lat.ToString());
40: Isolate.WhenCalled(() => fakeItem["Longitude"]).WillReturn(lng.ToString());
41: return fakeItem;
42: }
43: 
44: private static SPListItem CreateZoomAreaSPListItem(string areaName, double lat, double lng, double radius, int zoom)
45: {
46: var fakeItem = Isolate.Fake.Instance<SPListItem>();
47: Isolate.WhenCalled(() => fakeItem["Title"]).WillReturn(areaName);
48: Isolate.WhenCalled(() => fakeItem["Latitude"]).WillReturn(lat.ToString());
49: Isolate.WhenCalled(() => fakeItem["Longitude"]).WillReturn(lng.ToString());
50: Isolate.WhenCalled(() => fakeItem["Radius"]).WillReturn(radius.ToString());
51: Isolate.WhenCalled(() => fakeItem["Zoom"]).WillReturn(zoom.ToString());
52: return fakeItem;
53: }
54: 
55: }

A check of the returned values shows

  • web.Lists["Centre Locations"].Items.Count returns 2
  • web.Lists["Map Zoom Areas"].Items.Count) returns 1