Recently I have been assigned a task to implement Unit Testing for my SharePoint object model code. I have gone through the "MSDN" reference. I am stuck now.
I would like to know the difference between MSPSite and BSPSite? When do we need to use one over another?
Code example:
string url = "http://someURL";
Guid listId = Guid.Empty;
int listItemId = -1;
MSPSite.BehaveAsNotImplemented();
BSPSite site = null;
BSPListItem item = null;
MSPSite.ConstructorString = (siteInstance, _url) =>
{
// Given a site and given the Default Web
site = new BSPSite(siteInstance);
BSPWeb web = site.SetRootWeb();
// That contains a list
BSPList list = web.Lists.SetOne();
// … with ID = ListId
list.ID = listId;
// … with two fields ContentType, Title
list.Fields.SetAll("ContentType", "Title");
item = list.Items.SetOne();
// Which contain a list item with ID = listItemId
item.ID = listItemId;
// with a value in ContentType
item.Items.SetAll(content, null);
};