Can this be done? Here is the method I'm testing:
public void SaveAvatarToFileSystem()
{
Directory.CreateDirectory(AvatarDirectory);
_file.SaveAs(FormattedFileName);
}
In my unit test, I'm using Rhino.Mocks and I want to verify that _file.SaveAs() was called. I've mocked out _file (which is an HttpPostedFileBase object) and injected it into this method's class constructor. I want to run this unit test, but not actually have the Directory.CreateDirectory call get made. Is this possible?