Had a problem mocking a call to SPWorkflowActivationProperties.Item today. Turns out to be a bug in the TypeMock library. Problematic unit test [Test, Isolated] public void PublishToExternalDocumentLibrary_Calls_CopyTo_Correctly() { ApprovalWorkflow approvalWorkflow = Isolate.Fake.Instance<ApprovalWorkflow>(Members.CallOriginal, ConstructorWillBe.Called); SPWorkflowActivationProperties activationProperties = Isolate.Fake.Instance<SPWorkflowActivationProperties>(Members.CallOriginal, ConstructorWillBe.Called); SPListItem item = Isolate.Fake.Instance<SPListItem>(); Isolate.WhenCalled(() => approvalWorkflow.PublishWhenComplete).WillReturn(true); Isolate.WhenCalled(() => approvalWorkflow.PublishDocumentLibraryUrl).WillReturn(ExternalDocumentLibraryUrl); Isolate.WhenCalled(() => approvalWorkflow.WorkflowActivationProperties).WillReturn(activationProperties); Isolate.WhenCalled(() => activationProperties.Item).WillReturn(item); Isolate.WhenCalled(() [...]
Archive for the ‘unit testing’ Category
Typemock: System.NotSupportedException: Cannot dynamically create an instance of System.Void.
Posted in unit testing, tagged unit testing, typemock on April 19, 2010 | Leave a Comment »
Roy Osherove is giving an hands-on TDD Masterclass in the UK, September 21-25
Posted in .net, testing, unit testing, tagged TDD on August 25, 2009 | Leave a Comment »
Roy Osherove is giving an hands-on TDD Masterclass in the UK, September 21-25. Roy is author of “The Art of Unit Testing” (http://www.artofunittesting.com/), a leading tdd & unit testing book; he maintains a blog at http://iserializable.com (which amoung other things has critiqued tests written by Microsoft for asp.net MVC – check out the testreviews category) [...]
Unit testing for SharePoint
Posted in sharepoint, unit testing, tagged sharepoint, unit testing on December 4, 2008 | Leave a Comment »
Typemock are offering their new product for unit testing SharePoint called Isolator For SharePoint, for a special introduction price. it is the only tool that allows you to unit test SharePoint without a SharePoint server. To learn more click here. The first 50 bloggers who blog this text in their blog and tell us about [...]