var fakeRoles = MockRepository.GenerateStub < IDictionary<PermissionLevel, string>>();
fakeRoles[PermissionLevel.Developer] = "Developer";
fakeRoles[PermissionLevel.DeveloperManager] = "Developer Manager";
This is specific to what that method happens to be calling, and is irrelevant for the sake of my unit test. I'd rather do this:
fakeRoles.Stub(r => r[PermissionLevel.None]).IgnoreArguments().Return("Developer");
But I get an exception telling me to set the properties directly. Is there a way to tell rhino to just return the same value for any key given to this stub IDictionary
?