There were a few questions that I didn’t get to answering at the end of my Critical Path Training webinar last week. I apologize for not getting to them during the webinar, but I was already running significantly overtime, so I’ll address them here:
Q: Does cksapi.codeplex.com use the Microsoft Practices LoggerProxy project?
A: It does not directly use the Patterns and Practices material as there is a lot of “extra” stuff included (Service Locator, etc) that would have made just using the logging and exception handling more difficult. Our goal for CKS:API is to be a lightweight, largely independent collection of resources that do not require a lot of additional architectural elements. The P&P guidance is an excellent resource and if you find yourself needing a large percentage of it, I would strongly recommend looking at using it in its entirety. All of that said, some of the approaches and code practices in CKS:API are quite similar to the P&P guidance.
Q: How about Microsoft unit testing framework that comes out of the box with visual studio 2010, is this an option when it comes to SharePoint?
A: The unit testing tools in Visual Studio can be used to manage and run your tests for SharePoint. This is what I used in my demos. Due to some complexity in testing SharePoint, you need some facility to create mocks to stand in for standard SharePoint objects in order to eliminate your dependency on SharePoint. In the demo, I used TypeMock Isolator for this, but you could also use Microsoft’s Pex/Moles.
Q: How do you recommend using SpGuidance in code? because that puts more overhead and more objects runtime..
A: See my answer to question #1 above.
Q: Is CKS API logging service works in MOSS 2007 ?
A: Unfortunately, no. I may introduce this in the future, but right now there are no plans for it.
Q: What about TFS ?
A: TFS is not directly related to unit testing. It is a source code repository, team management/collaboration, project management tool (among other things). Using TFS on a SharePoint project is not very different from using it on any other project. I’ll be blogging about this more in the future.
Thanks to everyone who attended. As usual, I tried to jam too much information into the session so I feel like I glossed over some stuff. I’ll be posting more detail here on my blog in future articles.