Hello, I have some questions about unit testing with Justmock.
I have this very simple method (Share Point code):
Is it ok, that I test the methods return (Guid). I mean I test the contract of the method "CreateNewSite". If the site that should be created not exist, and the parameters are not empty, the new site will be created and a Guid != Guid.Empty will be returned. Otherwise return Guid.Emtpy.
Or should I test, that the method site.AllWebs.Add(newSite, newSite, "New Website", 1033, "STS#1", true, false).ID; was called with the right parameters?
How can I unit test the void methods (interaction testing) with Justmock.
For example this code:
Because the AddSplistItemToList is void, I want to test, that item["Title"] would set correctly (value from listItemTitle parameter). How I can test and fake this with Justmock?
I hope my questions are not too confused :)